Allow opening the app in a browser

For development purposes it's convenient to be able to open the app in
Chrome. To do this we skip invoking internal Tauri commands.
This commit is contained in:
Rūdolfs Ošiņš
2024-09-05 12:37:46 +02:00
committed by Sebastian Martinez
parent b6711a5698
commit 3d9e614ea3
2 changed files with 14 additions and 1 deletions
+6 -1
View File
@@ -16,7 +16,12 @@
onMount(async () => {
try {
await invoke("authenticate");
// For development purposes don't run tauri commands when viewing from
// a browser.
if (window.__TAURI_INTERNALS__) {
await invoke("authenticate");
}
void router.push({ resource: "home" });
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
+8
View File
@@ -0,0 +1,8 @@
declare global {
interface Window {
// eslint-disable-next-line @typescript-eslint/naming-convention
__TAURI_INTERNALS__: Record<string, unknown>;
}
}
export {};