(feat): tauri -> electron desktop app migration #9

Merged
alois merged 13 commits from dev into main 2026-05-25 16:35:36 +03:00
3 changed files with 8 additions and 6 deletions
Showing only changes of commit d16f260a3a - Show all commits

(fix): small desktop app bugs
Some checks failed
/ build-web (push) Successful in 1m12s
/ release (push) Has been cancelled
/ build-mobile (push) Has been cancelled
/ build-desktop (push) Has been cancelled

Alois 2026-05-24 23:52:33 +02:00

View file

@ -7,6 +7,7 @@ import {
} from "react";
import { getCurrent, onOpenUrl } from "@tauri-apps/plugin-deep-link";
import { isTauri } from "@tauri-apps/api/core";
import { useIsMobile } from "@tensamin/ui";
type DeeplinkContextValue = {
deeplinks: readonly string[];
@ -31,10 +32,10 @@ export default function DeeplinkProvider({
children: ReactNode;
}) {
const [deeplinks, setDeeplinks] = useState<string[]>([]);
const isTauriEnv = isTauri();
const isMobile = useIsMobile();
useEffect(() => {
if (!isTauriEnv) return;
if (!isTauri() || !isMobile) return;
let mounted = true;
let unlisten: (() => void) | undefined;
@ -57,7 +58,7 @@ export default function DeeplinkProvider({
mounted = false;
unlisten?.();
};
}, [isTauriEnv]);
}, [isMobile]);
return (
<deeplinkContext.Provider

View file

@ -156,7 +156,7 @@ export default function Navbar({ forMobile }: { forMobile: boolean }) {
)}
</>
)}
<Controls className="mr-2 ring-border" />
<Controls className="mr-2" />
</div>
</div>
);

View file

@ -1,4 +1,4 @@
import { Button, cn } from "@tensamin/ui";
import { Button, cn, useIsMobile } from "@tensamin/ui";
import { Input } from "@tensamin/ui";
import { Label } from "@tensamin/ui";
import { useStorage } from "@tensamin/storage/context";
@ -84,6 +84,7 @@ function parseTuFileContent(rawFileContent: string): {
}
export default function Form() {
const isMobile = useIsMobile();
const uploadRef = React.useRef<HTMLInputElement | null>(null);
const [isDragging, setIsDragging] = React.useState(false);
const { save } = useStorage();
@ -266,7 +267,7 @@ export default function Form() {
return (
<div className="relative flex md:flex-row flex-col gap-15">
{isTauri() ? (
{isTauri() && isMobile ? (
<>
<QrCodeScanner
onData={async (data) => {