fix(desktop): improve tauri permissions and settings UX

This commit is contained in:
Mohamed Boudra
2026-02-18 18:13:20 +07:00
parent b1955cf74d
commit 4affac9ce9
28 changed files with 1433 additions and 198 deletions
+5 -15
View File
@@ -1,23 +1,13 @@
import * as Linking from "expo-linking";
import { Platform } from "react-native";
import { getIsTauri } from "@/constants/layout";
interface TauriWindowWithOpener {
__TAURI__?: {
opener?: {
openUrl?: (url: string) => Promise<void>;
};
};
}
import { getTauri } from "@/utils/tauri";
export async function openExternalUrl(url: string): Promise<void> {
if (Platform.OS === "web") {
if (typeof window !== "undefined" && getIsTauri()) {
const opener = (window as TauriWindowWithOpener).__TAURI__?.opener?.openUrl;
if (typeof opener === "function") {
await opener(url);
return;
}
const opener = getTauri()?.opener?.openUrl;
if (typeof opener === "function") {
await opener(url);
return;
}
window.open(url, "_blank", "noopener,noreferrer");