Add close and refresh keybinds
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@@ -55,6 +65,7 @@ toast('Hello World', {
|
||||
|
||||
<Toaster hotkey={['KeyC']} />
|
||||
-->
|
||||
<svelte:window on:keydown={keyDown} />
|
||||
<Toaster theme="dark" expand visibleToasts={9} />
|
||||
<template>
|
||||
<Header />
|
||||
|
4
frontend/wailsjs/go/main/App.d.ts
vendored
Normal file
4
frontend/wailsjs/go/main/App.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export function Close():Promise<void>;
|
7
frontend/wailsjs/go/main/App.js
Normal file
7
frontend/wailsjs/go/main/App.js
Normal file
@@ -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']();
|
||||
}
|
Reference in New Issue
Block a user