Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Idle
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Sep 11, 2022
1 parent 61ae0eb commit 3294d3a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions interface/layout/app.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<Route path="/export"><Export /></Route>
<Route path="/edit"><Edit /></Route>
<Route path="/settings"><Settings /></Route>

<Route path="/idle"><div /></Route>
</RouteTransition>
</div>
</div>
Expand Down
20 changes: 14 additions & 6 deletions interface/layout/app.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import App from "./app.svelte"
import "../styles/index.css"
import { os, event, window } from "@tauri-apps/api"
import { os, event, window, invoke } from "@tauri-apps/api"
import { getSettings } from "../stores/settings"
import { navigate } from "../libraries/navigate"
import { checkUpdate, installUpdate } from "@tauri-apps/api/updater"
import { relaunch } from "@tauri-apps/api/process"
import { getState } from "interface/stores/state"

const settings = getSettings()
const state = getState()

// Create the svelte app
const app = new App({
target: document.body,
})

export default app

// Set background color if vibrancy not supported
const setBackground = async () => {
Expand Down Expand Up @@ -42,8 +53,9 @@ window.appWindow.onFocusChanged((focused) => {
window.appWindow.onCloseRequested((event) => {
if (settings.settings.minimizeToTray === true) {
event.preventDefault()

window.appWindow.hide()

navigate("idle")
}
})

Expand All @@ -52,9 +64,5 @@ document.addEventListener("contextmenu", (event) => {
event.preventDefault()
})

// Create svelte app
const app = new App({
target: document.body,
})

export default app

0 comments on commit 3294d3a

Please sign in to comment.