Skip to content

Commit

Permalink
fix: settings now load properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Apr 30, 2023
1 parent a58175f commit 723b325
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/windows/settings/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
import { WindowController } from "../../lib/controllers/WindowController";
import type { Unsubscriber } from "svelte/store";
import Setting from "./Setting.svelte";
import { ToastController } from "../../lib/controllers/ToastController";
let settingsFocusUnsub: any;
let themeUnsub: Unsubscriber;
let sgdbKeyUnsub: Unsubscriber;
let steamKeyUnsub: Unsubscriber;
let canSave = false;
let isFocused = false;
Expand All @@ -38,6 +41,8 @@
LogController.log("Saved settings.");
canSave = false;
ToastController.showSuccessToast("Settings saved!");
}
function cancel() {
Expand Down Expand Up @@ -80,8 +85,14 @@
}
onMount(async () => {
steamGridKey = $steamGridDBKey;
steamAPIKey = $steamKey;
sgdbKeyUnsub = steamGridDBKey.subscribe((value) => {
steamGridKey = value;
console.log("SGDB Key:", value);
});
steamKeyUnsub = steamKey.subscribe((value) => {
steamAPIKey = value;
console.log("Steam Key:", value);
});
WindowController.settingsWindow.onFocusChanged(({ payload: focused }) => {
isFocused = focused;
Expand Down

0 comments on commit 723b325

Please sign in to comment.