fix: stop using decorum on linux

This commit is contained in:
2024-09-14 15:08:40 +07:00
parent 278773433d
commit d2889edf99
5 changed files with 8 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ use std::{
time::Duration, time::Duration,
}; };
use tauri::{async_runtime::Mutex, Manager}; use tauri::{async_runtime::Mutex, Manager};
#[cfg(not(target_os = "linux"))]
use tauri_plugin_decorum::WebviewWindowExt; use tauri_plugin_decorum::WebviewWindowExt;
use tauri_specta::{collect_commands, Builder}; use tauri_specta::{collect_commands, Builder};
@@ -70,10 +71,11 @@ fn main() {
builder.mount_events(app); builder.mount_events(app);
let handle = app.handle(); let handle = app.handle();
#[cfg(not(target_os = "linux"))]
let main_window = app.get_webview_window("main").unwrap(); let main_window = app.get_webview_window("main").unwrap();
// Set custom decoration // Set custom decoration
#[cfg(not(target_os = "macos"))] #[cfg(target_os = "windows")]
main_window.create_overlay_titlebar().unwrap(); main_window.create_overlay_titlebar().unwrap();
// Set traffic light inset // Set traffic light inset

View File

@@ -151,7 +151,7 @@ export async function upload() {
"mov", "mov",
]; ];
const selected = await open({ const selectedPath = await open({
multiple: false, multiple: false,
filters: [ filters: [
{ {
@@ -162,10 +162,9 @@ export async function upload() {
}); });
// User cancelled action // User cancelled action
if (!selected) return null; if (!selectedPath) return null;
try { try {
const selectedPath = selected.path;
const file = await readFile(selectedPath); const file = await readFile(selectedPath);
const blob = new Blob([file]); const blob = new Blob([file]);

View File

@@ -5,6 +5,7 @@ import { LRUCache } from "lru-cache";
import { StrictMode } from "react"; import { StrictMode } from "react";
import ReactDOM from "react-dom/client"; import ReactDOM from "react-dom/client";
import "./global.css"; import "./global.css";
// Import the generated commands
import { commands } from "./commands"; import { commands } from "./commands";
// Import the generated route tree // Import the generated route tree
import { routeTree } from "./routes.gen"; import { routeTree } from "./routes.gen";

View File

@@ -21,10 +21,6 @@ import {
import { useEffect } from "react"; import { useEffect } from "react";
import { Virtualizer, type VirtualizerHandle } from "virtua"; import { Virtualizer, type VirtualizerHandle } from "virtua";
type ChatPayload = {
events: string[];
};
type EventPayload = { type EventPayload = {
event: string; event: string;
sender: string; sender: string;
@@ -53,7 +49,7 @@ function Header() {
data-tauri-drag-region data-tauri-drag-region
className={cn( className={cn(
"h-12 shrink-0 flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800", "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",
)} )}
> >
<div className="z-[200]"> <div className="z-[200]">

View File

@@ -1,6 +1,6 @@
import { commands } from "@/commands"; import { commands } from "@/commands";
import { npub } from "@/commons"; 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 { ArrowRight, DotsThree, GearSix, Plus } from "@phosphor-icons/react";
import { Link, createLazyFileRoute } from "@tanstack/react-router"; import { Link, createLazyFileRoute } from "@tanstack/react-router";
import { Menu, MenuItem } from "@tauri-apps/api/menu"; import { Menu, MenuItem } from "@tauri-apps/api/menu";