This commit is contained in:
ed 2022-09-22 19:20:33 +02:00
parent 1c0017d763
commit 249b63453b

View file

@ -2573,10 +2573,8 @@ function up2k_init(subtle) {
} }
} }
if (new_state !== undefined) { if (new_state !== undefined)
uc.fsearch = new_state; bcfg_set('fsearch', uc.fsearch = new_state);
bcfg_set('fsearch', uc.fsearch);
}
try { try {
clmod(ebi('u2c3w'), 's', !can_write); clmod(ebi('u2c3w'), 's', !can_write);
@ -2611,7 +2609,7 @@ function up2k_init(subtle) {
} }
catch (ex) { catch (ex) {
toast.err(5, "not supported on your browser:\n" + esc(basenames(ex))); toast.err(5, "not supported on your browser:\n" + esc(basenames(ex)));
bcfg_set('flag_en', false); bcfg_set('flag_en', uc.flag_en = false);
} }
} }
else if (!uc.flag_en && flag) { else if (!uc.flag_en && flag) {
@ -2633,20 +2631,32 @@ function up2k_init(subtle) {
function set_hashw() { function set_hashw() {
if (!window.WebAssembly) { if (!window.WebAssembly) {
bcfg_set('hashw', false); bcfg_set('hashw', uc.hashw = false);
toast.err(10, L.u_nowork); toast.err(10, L.u_nowork);
} }
} }
function set_upnag(en) { function set_upnag(en) {
if (!window.Notification) { function nopenag() {
bcfg_set('upnag', false); bcfg_set('upnag', uc.upnag = false);
toast.err(10, "https only"); toast.err(10, "https only");
} }
function chknag() {
if (Notification.permission != 'granted')
nopenag();
}
if (!window.Notification)
return nopenag();
if (en && Notification.permission == 'default') if (en && Notification.permission == 'default')
Notification.requestPermission(); Notification.requestPermission().then(chknag, chknag);
} }
if (uc.upnag && !window.Notification || Notification.permission != 'granted')
bcfg_set('upnag', uc.upnag = false);
ebi('nthread_add').onclick = function (e) { ebi('nthread_add').onclick = function (e) {
ev(e); ev(e);
bumpthread(1); bumpthread(1);