diff --git a/src/modules/keyboard.ts b/src/modules/keyboard.ts index ebb10fb..273dfd7 100644 --- a/src/modules/keyboard.ts +++ b/src/modules/keyboard.ts @@ -1,4 +1,5 @@ import { goto } from '$app/navigation'; +import { PUBLIC_TAURI } from '$env/static/public'; import type { ExpanderType } from "./index.d.ts"; import { getCurrentWindow } from "@tauri-apps/api/window"; import { incTextSize, decTextSize, selectNextColor, toggleMenuOpen, appState } from "$lib/stores.svelte" @@ -136,19 +137,22 @@ hotkeys.set("F2", { hotkeys.set("F11", { action: (e) => { - e.preventDefault() console.log("Toggle fullscreen") - if (fullscreen) { - getCurrentWindow().setFullscreen(false).then(() => { - fullscreen = false + console.log(PUBLIC_TAURI) + if(PUBLIC_TAURI == true) { + e.preventDefault() + if (fullscreen) { + getCurrentWindow().setFullscreen(false).then(() => { + fullscreen = false - - }); - } else { - getCurrentWindow().setFullscreen(true).then(() => { - fullscreen = true + + }); + } else { + getCurrentWindow().setFullscreen(true).then(() => { + fullscreen = true - }); + }); + } } } })