diff --git a/app.go b/app.go
index a29c6af..2c9cfee 100644
--- a/app.go
+++ b/app.go
@@ -2,6 +2,8 @@ package main
import (
"context"
+
+ "github.com/wailsapp/wails/v2/pkg/runtime"
)
// App struct
@@ -19,3 +21,6 @@ func NewApp() *App {
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
+func (a *App) Close() {
+ runtime.Quit(a.ctx)
+}
\ No newline at end of file
diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte
index dfa3289..1cbff65 100644
--- a/frontend/src/App.svelte
+++ b/frontend/src/App.svelte
@@ -2,6 +2,16 @@
import Header from "$lib/components/Header.svelte";
import Router from "$lib/router/Router.svelte";
import { Toaster } from "svelte-sonner";
+ import { Close } from '$wails/main/App'
+
+ function keyDown(event: KeyboardEvent) {
+ if (event.ctrlKey && event.key == "r") {
+ window.location.reload();
+ }
+ if (event.ctrlKey && event.key == "w") {
+ Close();
+ }
+ }
+
diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts
new file mode 100644
index 0000000..7e3d876
--- /dev/null
+++ b/frontend/wailsjs/go/main/App.d.ts
@@ -0,0 +1,4 @@
+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
+// This file is automatically generated. DO NOT EDIT
+
+export function Close():Promise;
diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js
new file mode 100644
index 0000000..abd085d
--- /dev/null
+++ b/frontend/wailsjs/go/main/App.js
@@ -0,0 +1,7 @@
+// @ts-check
+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
+// This file is automatically generated. DO NOT EDIT
+
+export function Close() {
+ return window['go']['main']['App']['Close']();
+}