Skip to content

Commit 17ca2eb

Browse files
committed
release: v1.0.1 - UI fixes and improved Tauri detection
1 parent e6b5ae4 commit 17ca2eb

File tree

6 files changed

+25
-11
lines changed

6 files changed

+25
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mediagrab",
33
"private": true,
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mediagrab"
3-
version = "0.1.0"
3+
version = "1.0.1"
44
description = "A Tauri App"
55
authors = ["you"]
66
edition = "2021"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "MediaGrab",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"identifier": "com.mediagrab",
66
"plugins": {},
77
"build": {

src/lib/tauri-mock.ts

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

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-
);
6+
// Check if running in Tauri 2.0
7+
// In Tauri 2.0, the app runs on tauri://localhost or https://tauri.localhost
8+
export const isTauri = (() => {
9+
if (typeof window === 'undefined') return false;
10+
11+
// Check for Tauri internals (Tauri 2.0)
12+
if ('__TAURI_INTERNALS__' in window) return true;
13+
14+
// Check for legacy Tauri 1.x
15+
if ('__TAURI__' in window) return true;
16+
17+
// Check protocol (Tauri 2.0 uses tauri:// or https://tauri.localhost)
18+
const protocol = window.location.protocol;
19+
const hostname = window.location.hostname;
20+
21+
if (protocol === 'tauri:') return true;
22+
if (hostname === 'tauri.localhost') return true;
23+
24+
return false;
25+
})();
1326

1427
// Mock data
1528
const mockPreferences = {

src/lib/tauri.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export { isTauri };
1010

1111
// Invoke wrapper
1212
export async function invoke<T>(cmd: string, args?: Record<string, unknown>): Promise<T> {
13+
console.log(`[Tauri] isTauri=${isTauri}, cmd=${cmd}`);
1314
if (isTauri) {
1415
const { invoke: tauriInvoke } = await import('@tauri-apps/api/core');
1516
return tauriInvoke<T>(cmd, args);

0 commit comments

Comments
 (0)