Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Fixed default settings not being written
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixeluted committed Apr 22, 2024
1 parent 94ed1a2 commit aa5fcf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "krampui"
version = "1.1.8"
version = "1.2.0"
authors = ["Snipcola", "Pixeluted"]
license = "MIT"
edition = "2021"
Expand Down
8 changes: 4 additions & 4 deletions src/assets/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ async function getSettings() {
autoUpdate: json.autoUpdate === undefined ? true : json.autoUpdate
};
else {
const settings = {
const defaultSettings = {
autoInject: false,
topMost: true,
keyToggle: false,
Expand All @@ -219,13 +219,13 @@ async function getSettings() {
autoUpdate: true
};

await saveSettings(settings);
return settings;
await saveSettings(defaultSettings);
return defaultSettings;
}
}

async function saveSettings(data) {
await writeFile(`${dataDirectory}/settings`, JSON.stringify(settings));
await writeFile(`${dataDirectory}/settings`, JSON.stringify(data));
}

async function getWindowDimensions() {
Expand Down

0 comments on commit aa5fcf5

Please sign in to comment.