update button on USO page now confirms only on the first click

This commit is contained in:
tophf 2017-11-21 13:33:11 +03:00
parent f1836f399f
commit e8d0c7d039

View File

@ -223,10 +223,12 @@ function onUpdate() {
function saveStyleCode(message, name, addProps) { function saveStyleCode(message, name, addProps) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!confirm(chrome.i18n.getMessage(message, [name]))) { const needsConfirmation = message === 'styleInstall' || !saveStyleCode.confirmed;
if (needsConfirmation && !confirm(chrome.i18n.getMessage(message, [name]))) {
reject(); reject();
return; return;
} }
saveStyleCode.confirmed = true;
enableUpdateButton(false); enableUpdateButton(false);
getStyleJson().then(json => { getStyleJson().then(json => {
if (!json) { if (!json) {