Skip to content

Commit

Permalink
fix: message bubble
Browse files Browse the repository at this point in the history
  • Loading branch information
cstrikeasia committed Dec 2, 2024
1 parent 2848f27 commit 7905cea
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/css/lang/zh-Hant/setting/main/box.css
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ li {
}

.extended-list-box {
width: 100%;
width: 80%;
border-bottom: unset !important;
padding: 2 !important;
justify-content: space-between;
Expand Down
12 changes: 8 additions & 4 deletions src/js/setting/plugin_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ class PluginList {

init() {
this.extendedConfirmWrapper.addEventListener('click', (event) => {
if (!this.extendedConfirmWrapper.classList.contains('extendedOpen')) {
return;
}
const { classList } = event.target;
if (classList.contains('confirm-sure')) {
this.setExtendedState();
this.bubble.showBubble('success', 3000);
setTimeout(() => {
ipcRenderer.send('all-reload');
}, 4000);
}
else if (classList.contains('confirm-cancel')) {
this.checkExtendedState();
Expand Down Expand Up @@ -234,17 +241,14 @@ class PluginList {
}
localStorage.setItem('enabled-plugins', JSON.stringify(this.enablePluginList));
this.hideConfirmWrapper();
this.bubble.showBubble('success', 3000);
}

hideConfirmWrapper() {
this.bubble.showBubble('success', 30000);
this.extendedConfirmWrapper.classList.remove('extendedOpen');
this.extendedConfirmWrapper.style.bottom = '-100%';
this.ConfirmTitle.textContent = '';
clearInterval(this.interval);
setTimeout(() => {
ipcRenderer.send('all-reload');
}, 4000);
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/js/setting/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ class Reset {
const { classList } = event.target;
if (classList[0] == 'confirm-sure') {
this.resetConfirmWrapper.style.bottom = '-100%';
this.bubble.showBubble('success', 30000);
this.bubble.showBubble('success', 3000);
Config.getInstance().resetConfig();
setTimeout(() => {
ipcRenderer.send('all-reload');
}, 4000);
}
else if (classList[0] == 'confirm-cancel') {
this.resetConfirmWrapper.style.bottom = '-100%';
this.hideConfirmWrapper();
}
});
}
Expand Down Expand Up @@ -85,5 +85,11 @@ class Reset {
}
}, 1000);
}

hideConfirmWrapper() {
this.resetConfirmWrapper.classList.remove('reset');
this.resetConfirmWrapper.style.bottom = '-100%';
clearInterval(this.interval);
}
}
new Reset();

0 comments on commit 7905cea

Please sign in to comment.