mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
refactor: support edit the gp.conf
This commit is contained in:
@@ -79,6 +79,12 @@ export const opensslConfigAtom = atomWithDefault(async () => {
|
||||
return settingsService.getOpenSSLConfig();
|
||||
});
|
||||
|
||||
export const openconnectConfigAtom = atomWithDefault<string | Promise<string>>(
|
||||
() => {
|
||||
return settingsService.getOpenconnectConfig();
|
||||
}
|
||||
);
|
||||
|
||||
export const saveSettingsAtom = atom(null, async (get, set) => {
|
||||
const clientOS = get(clientOSAtom);
|
||||
const osVersion = get(osVersionAtom);
|
||||
@@ -95,4 +101,11 @@ export const saveSettingsAtom = atom(null, async (get, set) => {
|
||||
if (customOpenSSL) {
|
||||
await settingsService.updateOpenSSLConfig();
|
||||
}
|
||||
|
||||
const initialOpenconnectConfig = await settingsService.getOpenconnectConfig();
|
||||
const openconnectConfig = await get(openconnectConfigAtom);
|
||||
|
||||
if (initialOpenconnectConfig !== openconnectConfig) {
|
||||
await settingsService.updateOpenconnectConfig(openconnectConfig);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user