drained: fix menu redraw

pull/2728/head
Rob Pilling 2023-05-10 21:24:47 +01:00
parent efe023c5cb
commit fe1a11e098
1 changed files with 6 additions and 5 deletions

View File

@ -62,13 +62,15 @@ type DrainedSettings = {
onchange: (b: boolean) => {
settings.keepStartup = b;
save();
updateMenu();
E.showMenu(menu);
updateAndRedraw();
},
},
};
const updateMenu = () => {
const updateAndRedraw = () => {
// will change the menu, queue redraw:
setTimeout(() => { E.showMenu(menu) }, 10);
if (settings.keepStartup) {
delete menu["Startup exceptions"];
return;
@ -98,6 +100,5 @@ type DrainedSettings = {
});
};
updateMenu();
E.showMenu(menu);
updateAndRedraw();
}) satisfies SettingsFunc