refactor: simplify theme import handling and remove redundant code

This commit is contained in:
Hachi-R 2025-02-16 16:10:02 -03:00
parent ef28337729
commit 569c80cbf4
9 changed files with 53 additions and 85 deletions

View file

@ -10,7 +10,6 @@ import { PythonRPC } from "./services/python-rpc";
import { Aria2 } from "./services/aria2";
import { db, levelKeys } from "./level";
import { loadState } from "./main";
import { sleep } from "./helpers";
const { autoUpdater } = updater;
@ -93,15 +92,7 @@ const handleDeepLinkPath = (uri?: string) => {
const authorCode = url.searchParams.get("author");
if (themeName && authorCode) {
WindowManager.redirect(`settings?theme=true`);
sleep(1000).then(() => {
WindowManager.mainWindow?.webContents.send(
"import-theme",
themeName,
authorCode
);
});
WindowManager.redirect(`settings?theme=${themeName}&author=${authorCode}`);
}
}
} catch (error) {