Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Fix platform detection

Scott Petrovic5688af8a45c1
diff --git a/src/lib/PlatformManager.ts b/src/lib/PlatformManager.ts
index b4c0540..84dee2f 100644
--- a/src/lib/PlatformManager.ts
+++ b/src/lib/PlatformManager.ts
@@ -1,24 +1,32 @@
+import { StringStreamHandler } from "three/examples/jsm/libs/fflate.module.js";
+
/**
* PlatformManager class
* We have a desktop application built with Tauri. This will help us conditionally show/hide things on the desktop app
since there is a good chance the desktop app will not have a internet connection
**/
+
+export enum Platform {
+ Web = "Web",
+ Desktop = "Desktop"
+}
+
export class PlatformManager {
private isTauri: boolean;
- private platform: 'desktop' | 'web';
+ private platform: Platform;
constructor() {
this.isTauri = '__TAURI_INTERNALS__' in window;
- this.platform = this.isTauri ? 'desktop' : 'web';
- console.log(this.platform ? 'Plastform: Desktop' : 'Platform: Web');
+ this.platform = this.isTauri ? Platform.Desktop : Platform.Web;
+ console.log(`Platform: ${this.platform}`);
}
public init() {
document.documentElement.dataset.platform = this.platform;
- if (this.platform === 'desktop') {
+ if (this.platform === Platform.Desktop) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = '/desktop.css';