Skip to content

Commit e6b5ae4

Browse files
committed
fix: improve Tauri detection for real API calls
1 parent b9da13d commit e6b5ae4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib/tauri-mock.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
* This allows running `npm run dev` without Tauri
44
*/
55

6-
// Check if running in Tauri
7-
export const isTauri = typeof window !== 'undefined' && '__TAURI__' in window;
6+
// Check if running in Tauri - check multiple indicators
7+
export const isTauri = typeof window !== 'undefined' && (
8+
'__TAURI__' in window ||
9+
'__TAURI_INTERNALS__' in window ||
10+
window.location.protocol === 'tauri:' ||
11+
window.location.protocol === 'https:' && window.location.hostname === 'tauri.localhost'
12+
);
813

914
// Mock data
1015
const mockPreferences = {

0 commit comments

Comments
 (0)