summaryrefslogtreecommitdiff
path: root/frontend/src/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/index.tsx')
-rw-r--r--frontend/src/index.tsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx
index 03010e13..86dd90e1 100644
--- a/frontend/src/index.tsx
+++ b/frontend/src/index.tsx
@@ -1,3 +1,5 @@
+import { Navigation, Router, sleep } from 'decky-frontend-lib';
+
import PluginLoader from './plugin-loader';
import { DeckyUpdater } from './updater';
@@ -15,6 +17,22 @@ declare global {
}
(async () => {
+ try {
+ if (!Router.NavigateToAppProperties || !Router.NavigateToLibraryTab || !Router.NavigateToInvites) {
+ while (!Navigation.NavigateToAppProperties) await sleep(100);
+ const shims = {
+ NavigateToAppProperties: Navigation.NavigateToAppProperties,
+ NavigateToInvites: Navigation.NavigateToInvites,
+ NavigateToLibraryTab: Navigation.NavigateToLibraryTab,
+ };
+ Object.assign(Router, shims);
+ }
+ } catch (e) {
+ console.error('[DECKY]: Error initializing Navigation interface shims', e);
+ }
+})();
+
+(async () => {
window.deckyAuthToken = await fetch('http://127.0.0.1:1337/auth/token').then((r) => r.text());
window.DeckyPluginLoader?.dismountAll();