forked from React-Group/interstellar_ai
yesyes very good fix
This commit is contained in:
parent
d4507c74a7
commit
29fd6d0a05
1 changed files with 22 additions and 23 deletions
|
@ -8,9 +8,11 @@ export function exportSettings(): string {
|
|||
for (let i = 0; i < localStorage.length; i++) {
|
||||
const key = localStorage.key(i);
|
||||
if (key) {
|
||||
if (key !== "accountName" && key !== "accountPassword" && key !== "accountEmail") {
|
||||
settings[key] = localStorage.getItem(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Convert settings object to JSON string
|
||||
return JSON.stringify(settings, null, 2);
|
||||
|
@ -21,9 +23,6 @@ export function importSettings(jsonData: string): void {
|
|||
try {
|
||||
const parsedSettings = JSON.parse(jsonData);
|
||||
|
||||
// Clear the current localStorage
|
||||
localStorage.clear();
|
||||
|
||||
// Loop through parsed settings and save them in localStorage
|
||||
Object.keys(parsedSettings).forEach((key) => {
|
||||
localStorage.setItem(key, parsedSettings[key]);
|
||||
|
|
Loading…
Reference in a new issue