fix: slash command does not work (#207)

This commit is contained in:
lencx
2023-01-15 18:02:23 +08:00
parent 4f03487a53
commit a798a8a784
9 changed files with 84 additions and 38 deletions

View File

@@ -40,7 +40,7 @@ window.uid = uid;
window.invoke = invoke;
window.transformCallback = transformCallback;
$(async function () {
async function init() {
if (__TAURI_METADATA__.__currentWindow.label === 'tray') {
document.getElementsByTagName('html')[0].style['font-size'] = '70%';
}
@@ -91,4 +91,13 @@ $(async function () {
window.__sync_prompts = async function() {
await invoke('sync_prompts', { time: Date.now() });
}
});
}
if (
document.readyState === "complete" ||
document.readyState === "interactive"
) {
init();
} else {
document.addEventListener("DOMContentLoaded", init);
}