diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index eed33f4..5d75a54 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -14,6 +14,7 @@ use std::{ time::Duration, }; use tauri::{async_runtime::Mutex, Manager}; +#[cfg(not(target_os = "linux"))] use tauri_plugin_decorum::WebviewWindowExt; use tauri_specta::{collect_commands, Builder}; @@ -70,10 +71,11 @@ fn main() { builder.mount_events(app); let handle = app.handle(); + #[cfg(not(target_os = "linux"))] let main_window = app.get_webview_window("main").unwrap(); // Set custom decoration - #[cfg(not(target_os = "macos"))] + #[cfg(target_os = "windows")] main_window.create_overlay_titlebar().unwrap(); // Set traffic light inset diff --git a/src/commons.ts b/src/commons.ts index 329f0a8..f39ff01 100644 --- a/src/commons.ts +++ b/src/commons.ts @@ -151,7 +151,7 @@ export async function upload() { "mov", ]; - const selected = await open({ + const selectedPath = await open({ multiple: false, filters: [ { @@ -162,10 +162,9 @@ export async function upload() { }); // User cancelled action - if (!selected) return null; + if (!selectedPath) return null; try { - const selectedPath = selected.path; const file = await readFile(selectedPath); const blob = new Blob([file]); diff --git a/src/main.tsx b/src/main.tsx index 16644ea..331baaf 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -5,6 +5,7 @@ import { LRUCache } from "lru-cache"; import { StrictMode } from "react"; import ReactDOM from "react-dom/client"; import "./global.css"; +// Import the generated commands import { commands } from "./commands"; // Import the generated route tree import { routeTree } from "./routes.gen"; diff --git a/src/routes/$account.chats.$id.lazy.tsx b/src/routes/$account.chats.$id.lazy.tsx index 431fe8b..d0e02e8 100644 --- a/src/routes/$account.chats.$id.lazy.tsx +++ b/src/routes/$account.chats.$id.lazy.tsx @@ -21,10 +21,6 @@ import { import { useEffect } from "react"; import { Virtualizer, type VirtualizerHandle } from "virtua"; -type ChatPayload = { - events: string[]; -}; - type EventPayload = { event: string; sender: string; @@ -53,7 +49,7 @@ function Header() { data-tauri-drag-region className={cn( "h-12 shrink-0 flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800", - platform === "windows" ? "pl-3.5 pr-[150px]" : "px-3.5" + platform === "windows" ? "pl-3.5 pr-[150px]" : "px-3.5", )} >
diff --git a/src/routes/index.lazy.tsx b/src/routes/index.lazy.tsx index 0627e61..22633c0 100644 --- a/src/routes/index.lazy.tsx +++ b/src/routes/index.lazy.tsx @@ -1,6 +1,6 @@ import { commands } from "@/commands"; import { npub } from "@/commons"; -import { Frame, User, Spinner } from "@/components"; +import { Frame, Spinner, User } from "@/components"; import { ArrowRight, DotsThree, GearSix, Plus } from "@phosphor-icons/react"; import { Link, createLazyFileRoute } from "@tanstack/react-router"; import { Menu, MenuItem } from "@tauri-apps/api/menu";