diff options
Diffstat (limited to 'frontend/src/plugin-loader.tsx')
| -rw-r--r-- | frontend/src/plugin-loader.tsx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx index 31f4ec7e..7f0f0160 100644 --- a/frontend/src/plugin-loader.tsx +++ b/frontend/src/plugin-loader.tsx @@ -12,7 +12,7 @@ import { sleep, } from '@decky/ui'; import { FC, lazy } from 'react'; -import { FaDownload, FaExclamationCircle, FaPlug } from 'react-icons/fa'; +import { FaDownload, FaExclamationCircle, FaExclamationTriangle, FaPlug } from 'react-icons/fa'; import DeckyIcon from './components/DeckyIcon'; import { DeckyState, DeckyStateContextProvider, UserInfo, useDeckyState } from './components/DeckyState'; @@ -153,6 +153,9 @@ class PluginLoader extends Logger { Promise.all([this.getUserInfo(), this.updateVersion()]) .then(() => this.loadPlugins()) .then(() => this.log('Initialized')) + .then(() => { + this.notifySupportStatus(); + }) // TODO safeguard this .then(() => sleep(30000)) // Internet might not immediately be up .then(() => this.checkPluginUpdates()); } @@ -219,6 +222,19 @@ class PluginLoader extends Logger { this.checkPluginUpdates(); } + private async notifySupportStatus() { + await this.routerHook.waitForUnlock(); + if (this.deckyState.publicState().versionInfo?.supported) { + this.toaster.toast({ + title: <TranslationHelper transClass={TranslationClass.PLUGIN_LOADER} transText="decky_unsupported" />, + body: <TranslationHelper transClass={TranslationClass.PLUGIN_LOADER} transText="decky_unsupported_body" />, + logo: <DeckyIcon />, + icon: <FaExclamationTriangle />, + onClick: () => Navigation.Navigate('/decky/settings'), + }); + } + } + public async getUserInfo() { const userInfo = await DeckyBackend.call<[], UserInfo>('utilities/get_user_info'); setSetting('user_info.user_name', userInfo.username); |
