diff options
| author | TrainDoctor <traindoctor@protonmail.com> | 2022-11-13 16:01:06 -0800 |
|---|---|---|
| committer | TrainDoctor <traindoctor@protonmail.com> | 2022-11-13 16:01:06 -0800 |
| commit | de426397262f6b28d88f2f72a3941cfd52942b94 (patch) | |
| tree | a20356160c68781c8d0cf00666b2562a7ed1cfab /frontend/src | |
| parent | 17742e947a9a0f51a040173e22878981bd622ba8 (diff) | |
| download | decky-loader-de426397262f6b28d88f2f72a3941cfd52942b94.tar.gz decky-loader-de426397262f6b28d88f2f72a3941cfd52942b94.zip | |
Add errored plugins to plugin array for uninstalls
Diffstat (limited to 'frontend/src')
| -rw-r--r-- | frontend/src/plugin-loader.tsx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx index f24a9605..47747f75 100644 --- a/frontend/src/plugin-loader.tsx +++ b/frontend/src/plugin-loader.tsx @@ -8,7 +8,7 @@ import { sleep, staticClasses, } from 'decky-frontend-lib'; -import { lazy } from 'react'; +import { FC, lazy } from 'react'; import { FaExclamationCircle, FaPlug } from 'react-icons/fa'; import { DeckyState, DeckyStateContextProvider, useDeckyState } from './components/DeckyState'; @@ -245,6 +245,20 @@ class PluginLoader extends Logger { }); } catch (e) { this.error('Error loading plugin ' + name, e); + const TheError: FC<{}> = () => ( + <> + Error:{' '} + <pre> + <code>{e}</code> + </pre> + </> + ); + this.plugins.push({ + name: name, + version: version, + content: <TheError />, + icon: <FaExclamationCircle />, + }); this.toaster.toast({ title: 'Error loading ' + name, body: '' + e, icon: <FaExclamationCircle /> }); } } else throw new Error(`${name} frontend_bundle not OK`); |
