mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
[bugfix]: default go libsecret, support changing secret store (#493)
* [bugfix]: default go libsecret, support changing secret store * update readme and rename libsecret
This commit is contained in:
parent
92478b5ca5
commit
0a658e3a22
7 changed files with 79 additions and 2 deletions
|
|
@ -94,7 +94,7 @@ export const ApplicationSettings = () => {
|
|||
localSettings.fontError(onFontError);
|
||||
|
||||
return () => {
|
||||
ipc!.removeAllListeners('custom-font-error');
|
||||
ipc?.removeAllListeners('custom-font-error');
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,56 @@
|
|||
import { SelectItem } from '@mantine/core';
|
||||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSettingsStoreActions, useGeneralSettings } from '../../../../store/settings.store';
|
||||
import {
|
||||
SettingsSection,
|
||||
SettingOption,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import { Select } from '/@/renderer/components';
|
||||
|
||||
const localSettings = isElectron() ? window.electron.localSettings : null;
|
||||
|
||||
const PASSWORD_SETTINGS: SelectItem[] = [
|
||||
{ label: 'libsecret', value: 'gnome_libsecret' },
|
||||
{ label: 'KDE 4 (kwallet4)', value: 'kwallet' },
|
||||
{ label: 'KDE 5 (kwallet5)', value: 'kwallet5' },
|
||||
{ label: 'KDE 6 (kwallet6)', value: 'kwallet6' },
|
||||
];
|
||||
|
||||
export const PasswordSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
const settings = useGeneralSettings();
|
||||
const { setSettings } = useSettingsStoreActions();
|
||||
|
||||
const updateOptions: SettingOption[] = [
|
||||
{
|
||||
control: (
|
||||
<Select
|
||||
aria-label={t('setting.passwordStore')}
|
||||
clearable={false}
|
||||
data={PASSWORD_SETTINGS}
|
||||
defaultValue={settings.passwordStore ?? 'gnome_libsecret'}
|
||||
disabled={!isElectron()}
|
||||
onChange={(e) => {
|
||||
if (!e) return;
|
||||
localSettings?.set('password_store', e);
|
||||
setSettings({
|
||||
general: {
|
||||
...settings,
|
||||
passwordStore: e,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
description: t('setting.passwordStore', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.passwordStore', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
];
|
||||
|
||||
return <SettingsSection options={updateOptions} />;
|
||||
};
|
||||
|
|
@ -2,6 +2,10 @@ import { Divider, Stack } from '@mantine/core';
|
|||
import { UpdateSettings } from '/@/renderer/features/settings/components/window/update-settings';
|
||||
import { WindowSettings } from '/@/renderer/features/settings/components/window/window-settings';
|
||||
import { DiscordSettings } from '/@/renderer/features/settings/components/window/discord-settings';
|
||||
import isElectron from 'is-electron';
|
||||
import { PasswordSettings } from '/@/renderer/features/settings/components/window/password-settings';
|
||||
|
||||
const utils = isElectron() ? window.electron.utils : null;
|
||||
|
||||
export const WindowTab = () => {
|
||||
return (
|
||||
|
|
@ -11,6 +15,12 @@ export const WindowTab = () => {
|
|||
<DiscordSettings />
|
||||
<Divider />
|
||||
<UpdateSettings />
|
||||
{utils?.isLinux() && (
|
||||
<>
|
||||
<Divider />
|
||||
<PasswordSettings />
|
||||
</>
|
||||
)}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ export interface SettingsState {
|
|||
externalLinks: boolean;
|
||||
followSystemTheme: boolean;
|
||||
language: string;
|
||||
passwordStore?: string;
|
||||
playButtonBehavior: Play;
|
||||
resume: boolean;
|
||||
showQueueDrawerButton: boolean;
|
||||
|
|
@ -288,6 +289,7 @@ const initialState: SettingsState = {
|
|||
externalLinks: true,
|
||||
followSystemTheme: false,
|
||||
language: 'en',
|
||||
passwordStore: undefined,
|
||||
playButtonBehavior: Play.NOW,
|
||||
resume: false,
|
||||
showQueueDrawerButton: false,
|
||||
|
|
@ -600,7 +602,7 @@ export const useSettingsStore = create<SettingsSlice>()(
|
|||
return merge(currentState, persistedState);
|
||||
},
|
||||
name: 'store_settings',
|
||||
version: 7,
|
||||
version: 8,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue