mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-13 08:12:44 +10:00
feat: quit button
This commit is contained in:
@ -107,9 +107,9 @@ const navigation: NavigationItem[] = [
|
|||||||
prefix: "",
|
prefix: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Sign out",
|
label: "Quit Drop",
|
||||||
route: "/signout",
|
route: "/quit",
|
||||||
prefix: "",
|
prefix: "",
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
navIdx === currentNavigationIndex
|
navIdx === currentNavigationIndex
|
||||||
? 'text-zinc-100'
|
? 'text-zinc-100'
|
||||||
: 'text-zinc-400 group-hover:text-zinc-300',
|
: 'text-zinc-400 group-hover:text-zinc-300',
|
||||||
'transition text-sm font-display leading-6',
|
'truncate transition text-sm font-display leading-6',
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
{{ nav.label }}
|
{{ nav.label }}
|
||||||
|
|||||||
9
pages/quit.vue
Normal file
9
pages/quit.vue
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!-- This is perhaps one of the most complicated pages in this app -->
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { invoke } from "@tauri-apps/api/core";
|
||||||
|
|
||||||
|
await invoke("quit");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template></template>
|
||||||
@ -129,7 +129,7 @@
|
|||||||
: 'text-white bg-blue-600 hover:bg-blue-500',
|
: 'text-white bg-blue-600 hover:bg-blue-500',
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
Upload
|
Add
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@ -82,6 +82,11 @@ fn fetch_state(state: tauri::State<'_, Mutex<AppState>>) -> Result<AppState, Str
|
|||||||
Ok(cloned_state)
|
Ok(cloned_state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
fn quit(app: tauri::AppHandle) {
|
||||||
|
cleanup_and_exit(&app);
|
||||||
|
}
|
||||||
|
|
||||||
fn setup(handle: AppHandle) -> AppState {
|
fn setup(handle: AppHandle) -> AppState {
|
||||||
let logfile = FileAppender::builder()
|
let logfile = FileAppender::builder()
|
||||||
.encoder(Box::new(PatternEncoder::new("{d} | {l} | {f} - {m}{n}")))
|
.encoder(Box::new(PatternEncoder::new("{d} | {l} | {f} - {m}{n}")))
|
||||||
@ -157,8 +162,9 @@ pub fn run() {
|
|||||||
let mut app = builder
|
let mut app = builder
|
||||||
.plugin(tauri_plugin_deep_link::init())
|
.plugin(tauri_plugin_deep_link::init())
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![
|
||||||
// DB
|
// Core utils
|
||||||
fetch_state,
|
fetch_state,
|
||||||
|
quit,
|
||||||
// Auth
|
// Auth
|
||||||
auth_initiate,
|
auth_initiate,
|
||||||
retry_connect,
|
retry_connect,
|
||||||
|
|||||||
Reference in New Issue
Block a user