Don't persist settings tab

This commit is contained in:
Gregory Schier
2024-08-10 08:10:14 -07:00
parent 08ea48b996
commit ecc7192bde
4 changed files with 6 additions and 7 deletions

View File

@@ -69,7 +69,6 @@ export const RequestPane = memo(function RequestPane({
const handleContentTypeChange = useCallback( const handleContentTypeChange = useCallback(
async (contentType: string | null) => { async (contentType: string | null) => {
console.log('UPDATE CONTENT TYPE', contentType);
const headers = activeRequest.headers.filter((h) => h.name.toLowerCase() !== 'content-type'); const headers = activeRequest.headers.filter((h) => h.name.toLowerCase() !== 'content-type');
if (contentType != null) { if (contentType != null) {

View File

@@ -1,7 +1,7 @@
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'; import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
import classNames from 'classnames'; import classNames from 'classnames';
import React from 'react'; import React, { useState } from 'react';
import { useKeyPressEvent, useLocalStorage } from 'react-use'; import { useKeyPressEvent } from 'react-use';
import { useOsInfo } from '../../hooks/useOsInfo'; import { useOsInfo } from '../../hooks/useOsInfo';
import { capitalize } from '../../lib/capitalize'; import { capitalize } from '../../lib/capitalize';
import { HStack } from '../core/Stacks'; import { HStack } from '../core/Stacks';
@@ -20,7 +20,7 @@ const tabs = [Tab.General, Tab.Appearance];
export const Settings = () => { export const Settings = () => {
const osInfo = useOsInfo(); const osInfo = useOsInfo();
const [tab, setTab] = useLocalStorage<string>('settings_tab', Tab.General); const [tab, setTab] = useState<string>(Tab.General);
// Close settings window on escape // Close settings window on escape
// TODO: Could this be put in a better place? Eg. in Rust key listener when creating the window // TODO: Could this be put in a better place? Eg. in Rust key listener when creating the window

View File

@@ -37,8 +37,8 @@ export function SettingsGeneral() {
value={settings.updateChannel} value={settings.updateChannel}
onChange={(updateChannel) => updateSettings.mutate({ updateChannel })} onChange={(updateChannel) => updateSettings.mutate({ updateChannel })}
options={[ options={[
{ label: 'Release', value: 'stable' }, { label: 'Stable (less frequent)', value: 'stable' },
{ label: 'Early Bird (Beta)', value: 'beta' }, { label: 'Beta (more frequent)', value: 'beta' },
]} ]}
/> />
<IconButton <IconButton

View File

@@ -56,7 +56,7 @@ export function useIntrospectGraphQL(baseRequest: HttpRequest) {
} }
const { data } = JSON.parse(bodyText); const { data } = JSON.parse(bodyText);
console.log('Introspection response', data); console.log(`Got introspection response for ${baseRequest.url}`, data);
await setIntrospection(data); await setIntrospection(data);
}; };