yesyes very good fix

This commit is contained in:
Patrick_Pluto 2024-10-03 11:29:58 +02:00
parent d4507c74a7
commit 29fd6d0a05

View file

@ -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]);