Skip to content

Commit

Permalink
v8.3.14-dev.12 Settings: fix bug that does not persist some settings (c…
Browse files Browse the repository at this point in the history
…lose #1374)
  • Loading branch information
Rafael committed May 24, 2019
1 parent 0883095 commit 569e2cb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -53,7 +53,7 @@
"webpack-shell-plugin": "0.5.0",
"webpack-cli": "^3.1.0"
},
"devVersion": "8.3.14-dev.11",
"devVersion": "8.3.14-dev.12",
"homepage": "https://github.com/gsrafael01/ESGST",
"keywords": [
"esgst",
Expand Down
19 changes: 19 additions & 0 deletions src/modules/Settings.js
Expand Up @@ -2058,16 +2058,20 @@ class Settings {
}
lower.addEventListener(`change`, () => {
colors.lower = lower.value;
this.preSave(id, gSettings[id]);
});
upper.addEventListener(`change`, () => {
colors.upper = upper.value;
this.preSave(id, gSettings[id]);
});
color.addEventListener(`change`, () => {
colors.color = color.value;
this.preSave(id, gSettings[id]);
});
if (bgColor) {
bgColor.addEventListener(`change`, () => {
colors.bgColor = bgColor.value;
this.preSave(id, gSettings[id]);
});
}
remove.addEventListener(`click`, () => {
Expand Down Expand Up @@ -2280,18 +2284,23 @@ class Settings {
let remove = tooltip.nextElementSibling;
lower.addEventListener(`change`, () => {
colors.lower = lower.value;
this.preSave(`gc_r_colors`, gSettings.gc_r_colors);
});
upper.addEventListener(`change`, () => {
colors.upper = upper.value;
this.preSave(`gc_r_colors`, gSettings.gc_r_colors);
});
color.addEventListener(`change`, () => {
colors.color = color.value;
this.preSave(`gc_r_colors`, gSettings.gc_r_colors);
});
bgColor.addEventListener(`change`, () => {
colors.bgColor = bgColor.value;
this.preSave(`gc_r_colors`, gSettings.gc_r_colors);
});
icon.addEventListener(`change`, () => {
colors.icon = icon.value;
this.preSave(`gc_r_colors`, gSettings.gc_r_colors);
});
remove.addEventListener(`click`, () => {
if (window.confirm(`Are you sure you want to delete this setting?`)) {
Expand Down Expand Up @@ -2384,12 +2393,15 @@ class Settings {
remove = bgColor.nextElementSibling;
genre.addEventListener(`change`, () => {
colorSetting.genre = genre.value;
this.preSave(`gc_g_colors`, gSettings.gc_g_colors);
});
color.addEventListener(`change`, () => {
colorSetting.color = color.value;
this.preSave(`gc_g_colors`, gSettings.gc_g_colors);
});
bgColor.addEventListener(`change`, () => {
colorSetting.bgColor = bgColor.value;
this.preSave(`gc_g_colors`, gSettings.gc_g_colors);
});
remove.addEventListener(`click`, () => {
if (window.confirm(`Are you sure you want to delete this setting?`)) {
Expand All @@ -2399,6 +2411,7 @@ class Settings {
if (i < n) {
gcgcolors.splice(i, 1);
gSettings.gc_g_colors = gcgcolors;
this.preSave(`gc_g_colors`, gSettings.gc_g_colors);
setting.remove();
}
}
Expand Down Expand Up @@ -2538,21 +2551,27 @@ class Settings {
remove = label.nextElementSibling;
steamId.addEventListener(`change`, () => {
altSetting.steamId = steamId.value;
this.preSave(`gc_o_altAccounts`, gSettings.gc_o_altAccounts);
});
name.addEventListener(`change`, () => {
altSetting.name = name.value;
this.preSave(`gc_o_altAccounts`, gSettings.gc_o_altAccounts);
});
color.addEventListener(`change`, () => {
altSetting.color = color.value;
this.preSave(`gc_o_altAccounts`, gSettings.gc_o_altAccounts);
});
bgColor.addEventListener(`change`, () => {
altSetting.bgColor = bgColor.value;
this.preSave(`gc_o_altAccounts`, gSettings.gc_o_altAccounts);
});
icon.addEventListener(`change`, () => {
altSetting.icon = icon.value;
this.preSave(`gc_o_altAccounts`, gSettings.gc_o_altAccounts);
});
label.addEventListener(`change`, () => {
altSetting.label = label.value;
this.preSave(`gc_o_altAccounts`, gSettings.gc_o_altAccounts);
});
remove.addEventListener(`click`, () => {
if (window.confirm(`Are you sure you want to delete this setting?`)) {
Expand Down

0 comments on commit 569e2cb

Please sign in to comment.