Merge branch 'main' into main

This commit is contained in:
sageTheDm 2024-10-03 11:38:13 +02:00
commit 15d852c11d

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