summaryrefslogtreecommitdiff
path: root/frontend/src/plugin-loader.tsx
diff options
context:
space:
mode:
authorTrainDoctor <traindoctor@protonmail.com>2022-11-13 16:01:06 -0800
committerTrainDoctor <traindoctor@protonmail.com>2022-11-13 16:01:06 -0800
commitde426397262f6b28d88f2f72a3941cfd52942b94 (patch)
treea20356160c68781c8d0cf00666b2562a7ed1cfab /frontend/src/plugin-loader.tsx
parent17742e947a9a0f51a040173e22878981bd622ba8 (diff)
downloaddecky-loader-de426397262f6b28d88f2f72a3941cfd52942b94.tar.gz
decky-loader-de426397262f6b28d88f2f72a3941cfd52942b94.zip
Add errored plugins to plugin array for uninstalls
Diffstat (limited to 'frontend/src/plugin-loader.tsx')
-rw-r--r--frontend/src/plugin-loader.tsx16
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`);