Skip to content

Commit 2da39ae

Browse files
committed
Add native tauri check
1 parent 71bbcaf commit 2da39ae

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@capacitor/core": "^7.0.1",
4848
"@fortawesome/fontawesome-free": "^6.5.2",
4949
"@tauri-apps/api": "^2.3.0",
50-
"@tauri-apps/cli": "^2.3.1",
50+
"@tauri-apps/cli": "^2.5.0",
5151
"@vitejs/plugin-vue": "^5.2.1",
5252
"crypto-es": "^2.1.0",
5353
"d3": "^7.9.0",

src/js/utils/checkBrowserCompatibility.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,17 @@ export function isCapacitorWeb() {
6060
return false;
6161
}
6262

63+
export function isTauri() {
64+
return "__TAURI_INTERNALS__" in window;
65+
}
66+
6367
export function checkBrowserCompatibility() {
6468
const isWebSerial = checkWebSerialSupport();
6569
const isWebBluetooth = checkWebBluetoothSupport();
6670
const isWebUSB = checkWebUSBSupport();
6771
const isChromium = isChromiumBrowser();
6872

69-
const isNative = Capacitor.isNativePlatform();
73+
const isNative = Capacitor.isNativePlatform() || isTauri();
7074

7175
const compatible = isNative || (isChromium && (isWebSerial || isWebBluetooth || isWebUSB));
7276

0 commit comments

Comments
 (0)