summaryrefslogtreecommitdiff
path: root/frontend/src/components
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2023-12-30 00:46:59 -0500
committerAAGaming <aagaming@riseup.net>2023-12-30 00:46:59 -0500
commit6522ebf0cad1723a278144b6c5d8557cd47e52d6 (patch)
tree8c048cfe75c73938d347f8e6cd7b8bb23269df2c /frontend/src/components
parent6042ca56b85fffe6bac4cac5a2965ee87c4e1e32 (diff)
downloaddecky-loader-6522ebf0cad1723a278144b6c5d8557cd47e52d6.tar.gz
decky-loader-6522ebf0cad1723a278144b6c5d8557cd47e52d6.zip
Implement legacy & modern plugin method calls over WS
This version builds fine and runs all of the 14 plugins I have installed perfectly, so we're really close to having this done.
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/settings/pages/plugin_list/index.tsx12
1 files changed, 4 insertions, 8 deletions
diff --git a/frontend/src/components/settings/pages/plugin_list/index.tsx b/frontend/src/components/settings/pages/plugin_list/index.tsx
index 09d06d48..6475b40a 100644
--- a/frontend/src/components/settings/pages/plugin_list/index.tsx
+++ b/frontend/src/components/settings/pages/plugin_list/index.tsx
@@ -35,6 +35,8 @@ async function reinstallPlugin(pluginName: string, currentVersion?: string) {
type PluginTableData = PluginData & { name: string; hidden: boolean; onHide(): void; onShow(): void };
+const reloadPluginBackend = window.DeckyBackend.callable<[pluginName: string], void>('loader/reload_plugin');
+
function PluginInteractables(props: { entry: ReorderableEntry<PluginTableData> }) {
const { t } = useTranslation();
@@ -49,15 +51,9 @@ function PluginInteractables(props: { entry: ReorderableEntry<PluginTableData> }
showContextMenu(
<Menu label={t('PluginListIndex.plugin_actions')}>
<MenuItem
- onSelected={() => {
+ onSelected={async () => {
try {
- fetch(`http://127.0.0.1:1337/plugins/${name}/reload`, {
- method: 'POST',
- credentials: 'include',
- headers: {
- Authentication: window.deckyAuthToken,
- },
- });
+ await reloadPluginBackend(name);
} catch (err) {
console.error('Error Reloading Plugin Backend', err);
}