fixed null setting if remove active account

This commit is contained in:
Quan HL
2024-09-17 06:39:34 +07:00
parent e6b8903f36
commit 8af172d527

View File

@@ -126,14 +126,16 @@ export const getActiveSettings = (): IAppSettings => {
JSON.parse(str); JSON.parse(str);
const activeSettings = parsed.find((el) => el.active); const activeSettings = parsed.find((el) => el.active);
const decoded = { if (activeSettings) {
active: activeSettings?.active, const decoded = {
decoded: JSON.parse( active: activeSettings?.active,
Buffer.from(activeSettings?.encoded!, "base64").toString("utf-8") decoded: JSON.parse(
), Buffer.from(activeSettings?.encoded!, "base64").toString("utf-8")
id: activeSettings?.id, ),
}; id: activeSettings?.id,
return decoded as IAppSettings; };
return decoded as IAppSettings;
}
} }
return {} as IAppSettings; return {} as IAppSettings;
}; };