Skip to content

Commit

Permalink
Automatically select platform after browsing
Browse files Browse the repository at this point in the history
Merge pull request BetterDiscord#141 from QbDesu/automatically-select-after-browse
  • Loading branch information
zerebos authored Jul 10, 2021
2 parents d947de5 + 0cd1195 commit 7bd77bf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/renderer/pages/Platforms.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
canGoBack.set(true);
nextPage.set(`/${$action}`);
function updateInstallButtonState() {
if (Object.values($platforms).some(r => r)) canGoForward.set(true);
else canGoForward.set(false);
}
function change({target}) {
platforms.update(s => {
s[target.value] = target.checked;
return s;
});
if (Object.values($platforms).some(r => r)) canGoForward.set(true);
else canGoForward.set(false);
updateInstallButtonState();
}
async function click(event) {
Expand All @@ -37,6 +40,11 @@
obj[platform] = resourcesPath;
return obj;
});
platforms.update(obj => {
obj[platform] = Boolean(resourcesPath);
return obj;
});
updateInstallButtonState();
}
</script>

Expand Down

0 comments on commit 7bd77bf

Please sign in to comment.