初始化web服务功能
This commit is contained in:
11
src/lib/transport/detect.ts
Normal file
11
src/lib/transport/detect.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export type TransportEnvironment = "tauri" | "web"
|
||||
|
||||
export function detectEnvironment(): TransportEnvironment {
|
||||
if (
|
||||
typeof window !== "undefined" &&
|
||||
"__TAURI_INTERNALS__" in window
|
||||
) {
|
||||
return "tauri"
|
||||
}
|
||||
return "web"
|
||||
}
|
||||
Reference in New Issue
Block a user