From c52b20ca80d902664b1c23e127c81e7a8a6a0084 Mon Sep 17 00:00:00 2001 From: reya <123083837+reyamir@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:36:16 +0700 Subject: [PATCH] chore: bump version --- .github/workflows/main.yml | 2 +- apps/desktop2/src/components/column.tsx | 4 ++++ apps/desktop2/src/routes/panel.$account.tsx | 4 ++-- packages/system/src/commands.ts | 3 +++ src-tauri/src/commands/window.rs | 6 ++++++ src-tauri/src/main.rs | 1 + src-tauri/tauri.conf.json | 2 +- 7 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a36ca7a3..2d37e193 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,4 +70,4 @@ jobs: releaseDraft: true prerelease: false args: ${{ matrix.args }} - includeDebug: true + includeDebug: false diff --git a/apps/desktop2/src/components/column.tsx b/apps/desktop2/src/components/column.tsx index 3af62a1d..5e1a7e62 100644 --- a/apps/desktop2/src/components/column.tsx +++ b/apps/desktop2/src/components/column.tsx @@ -24,6 +24,8 @@ export const Column = memo(function Column({ const [isCreated, setIsCreated] = useState(false); const repositionWebview = useCallback(async () => { + if (!container?.current) throw new Error("something wrong."); + const newRect = container.current.getBoundingClientRect(); await invoke("reposition_column", { label: webviewLabel, @@ -33,6 +35,8 @@ export const Column = memo(function Column({ }, []); const resizeWebview = useCallback(async () => { + if (!container?.current) throw new Error("something wrong."); + const newRect = container.current.getBoundingClientRect(); await invoke("resize_column", { label: webviewLabel, diff --git a/apps/desktop2/src/routes/panel.$account.tsx b/apps/desktop2/src/routes/panel.$account.tsx index 7c7df400..e0ee69d6 100644 --- a/apps/desktop2/src/routes/panel.$account.tsx +++ b/apps/desktop2/src/routes/panel.$account.tsx @@ -13,9 +13,9 @@ import * as ScrollArea from "@radix-ui/react-scroll-area"; import * as Tabs from "@radix-ui/react-tabs"; import { useQuery } from "@tanstack/react-query"; import { createFileRoute } from "@tanstack/react-router"; +import { invoke } from "@tauri-apps/api/core"; import { Menu, MenuItem, PredefinedMenuItem } from "@tauri-apps/api/menu"; import { getCurrent } from "@tauri-apps/api/window"; -import { exit } from "@tauri-apps/plugin-process"; import { open } from "@tauri-apps/plugin-shell"; import { type ReactNode, useCallback, useEffect, useRef } from "react"; import { Virtualizer } from "virtua"; @@ -98,7 +98,7 @@ function Screen() { PredefinedMenuItem.new({ item: "Separator" }), MenuItem.new({ text: "Quit", - action: async () => await exit(0), + action: async () => await invoke("force_quit"), }), ]); diff --git a/packages/system/src/commands.ts b/packages/system/src/commands.ts index cf522b9f..3804c318 100644 --- a/packages/system/src/commands.ts +++ b/packages/system/src/commands.ts @@ -447,6 +447,9 @@ try { async openMainWindow() : Promise { await TAURI_INVOKE("open_main_window"); }, +async forceQuit() : Promise { +await TAURI_INVOKE("force_quit"); +}, async setBadge(count: number) : Promise { await TAURI_INVOKE("set_badge", { count }); } diff --git a/src-tauri/src/commands/window.rs b/src-tauri/src/commands/window.rs index bad1fc44..f3dce6f3 100644 --- a/src-tauri/src/commands/window.rs +++ b/src-tauri/src/commands/window.rs @@ -255,3 +255,9 @@ pub fn open_main_window(app: tauri::AppHandle) { window.make_transparent().unwrap(); } } + +#[tauri::command] +#[specta::specta] +pub fn force_quit() { + std::process::exit(0); +} diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index c2348f01..92301fa3 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -127,6 +127,7 @@ fn main() { commands::window::reload_column, commands::window::open_window, commands::window::open_main_window, + commands::window::force_quit, commands::window::set_badge ]); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e6f92839..de2b91ec 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/schema.json", "productName": "Lume", - "version": "4.0.13", + "version": "4.0.14", "identifier": "nu.lume.Lume", "build": { "beforeBuildCommand": "pnpm desktop:build",