fix: tauri loading and method loading

This commit is contained in:
linonetwo
2023-01-11 12:14:07 +08:00
parent 6aa679365a
commit cdc196322c
2 changed files with 11 additions and 8 deletions
+5 -1
View File
@@ -40,7 +40,11 @@ export class DataCenter {
};
};
// TODO: switch different provider
if (typeof window !== 'undefined' && window.CLIENT_APP) {
if (
typeof window !== 'undefined' &&
window.CLIENT_APP &&
typeof window.__TAURI_IPC__ === 'function'
) {
const { TauriIPCProvider } = await import('./provider/tauri-ipc');
dc.registerProvider(new TauriIPCProvider(getInitParams()));
}