Skip to content

Commit

Permalink
add a confirm action when tweety is not running
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Dec 8, 2023
1 parent 5eab78c commit 7007d48
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ async function main() {
origin = new URL(window.location.origin)
}

// check if tweety is running
const resp = await fetch(new URL("/ping", origin))
if (!resp.ok) {
confirm("Tweety is not running. Reload?")
window.close()
return
}

const config = await fetchJSON(new URL("/config", origin)) as Config
const lightTheme = await fetchTheme(config.theme || "Tomorrow", origin)
const darkTheme = await fetchTheme(config.themeDark || config.theme || "Tomorrow Night", origin)
Expand Down

0 comments on commit 7007d48

Please sign in to comment.