Skip to content

Commit

Permalink
Update electron.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Apr 30, 2023
1 parent 68ea21e commit 8df2778
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions source/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,23 +563,23 @@ host.ElectronHost = class {

_message(message, action) {
return new Promise((resolve) => {
const messageText = this._element('message-text');
if (messageText) {
messageText.innerText = message;
const text = this._element('message-text');
if (text) {
text.innerText = message;
}
const messageButton = this._element('message-button');
if (messageButton) {
const button = this._element('message-button');
if (button) {
if (action) {
messageButton.style.removeProperty('display');
messageButton.innerText = action;
messageButton.onclick = () => {
messageButton.onclick = null;
button.style.removeProperty('display');
button.innerText = action;
button.onclick = () => {
button.onclick = null;
this._document.body.classList.remove('message');
resolve();
};
} else {
messageButton.style.display = 'none';
messageButton.onclick = null;
button.style.display = 'none';
button.onclick = null;
}
}
this._document.body.classList.add('message');
Expand Down

0 comments on commit 8df2778

Please sign in to comment.