don't confirm on clicking "install" for a new usercss

This commit is contained in:
tophf 2017-11-24 19:40:18 +03:00
parent aedb02bbb1
commit e7175c261a

View File

@ -227,14 +227,17 @@
); );
} }
$('button.install').onclick = () => { $('button.install').onclick = () => {
messageBox.confirm(dup ? (!dup ?
t('styleInstallOverwrite', [data.name, dupData.version, data.version]) : Promise.resolve(true) :
t('styleInstall', [data.name]) messageBox.confirm(t('styleInstallOverwrite', [
data.name,
dupData.version,
data.version,
]))
).then(ok => ok && ).then(ok => ok &&
sendMessage(Object.assign(style, {method: 'saveUsercss', reason: 'update'})) sendMessage(Object.assign(style, {method: 'saveUsercss', reason: 'update'}))
.then(install) .then(install)
.catch(err => messageBox.alert(t('styleInstallFailed', err))) .catch(err => messageBox.alert(t('styleInstallFailed', err))));
);
}; };
// set updateUrl // set updateUrl