mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-31 22:04:06 +08:00
1 parent
cd191ac679
commit
2abc0b878c
6 files changed
+15
-7
No files matched your search
@@ -2727,6 +2727,7 @@ async function closeWorkspace() {
|
||||
}
|
||||
|
||||
async function closeApplicationWindow() {
|
||||
await window.ofdgoTheme.flush();
|
||||
window.removeEventListener("beforeunload", warnUnsaved);
|
||||
window.removeEventListener("beforeunload", warnBatch);
|
||||
let closed = false;
|
||||
|
||||
@@ -30,6 +30,13 @@
|
||||
report(error);
|
||||
});
|
||||
}
|
||||
async function flush() {
|
||||
let current;
|
||||
do {
|
||||
current = pending;
|
||||
await current;
|
||||
} while (current !== pending);
|
||||
}
|
||||
function set(value) {
|
||||
mode = value;
|
||||
apply();
|
||||
@@ -48,7 +55,7 @@
|
||||
mode = ["light", "dark"].includes(event.newValue) ? event.newValue : "system";
|
||||
apply();
|
||||
});
|
||||
window.ofdgoTheme = {set, connect(value, onError) {
|
||||
window.ofdgoTheme = {set, flush, connect(value, onError) {
|
||||
host = value;
|
||||
report = onError;
|
||||
const select = document.querySelector("#titleBarMaterial");
|
||||
|
||||
Reference in new issue
Block a user