mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix: make isTauri runtime-unrelated (#13145)
* Update core.ts * Update core.ts * Update core.ts * lint * build * fix lint, add change file --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
5
.changes/isTauri-tests.md
Normal file
5
.changes/isTauri-tests.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tauri-apps/api": patch:enhance
|
||||
---
|
||||
|
||||
`core.isTauri` now leverages `globalThis` instead of `window` in order to be used in unit tests.
|
||||
File diff suppressed because one or more lines are too long
@@ -325,7 +325,8 @@ export class Resource {
|
||||
}
|
||||
|
||||
function isTauri(): boolean {
|
||||
return 'isTauri' in window && !!window.isTauri
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access
|
||||
return !!((globalThis as any) || window).isTauri
|
||||
}
|
||||
|
||||
export type { InvokeArgs, InvokeOptions }
|
||||
|
||||
Reference in New Issue
Block a user