From 2e8e0fc7c153cdeae055f4f0a7158afbae0e3485 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Fri, 2 Jun 2023 03:44:55 +0200 Subject: Plugin backend reload (#463) Co-authored-by: beebls <102569435+beebls@users.noreply.github.com> --- .../components/settings/pages/plugin_list/index.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/src/components/settings/pages/plugin_list/index.tsx b/frontend/src/components/settings/pages/plugin_list/index.tsx index 17f6d99d..fab8ec2b 100644 --- a/frontend/src/components/settings/pages/plugin_list/index.tsx +++ b/frontend/src/components/settings/pages/plugin_list/index.tsx @@ -44,7 +44,23 @@ function PluginInteractables(props: { entry: ReorderableEntry }) { const showCtxMenu = (e: MouseEvent | GamepadEvent) => { showContextMenu( - window.DeckyPluginLoader.importPlugin(pluginName, data?.version)}> + { + try { + fetch(`http://127.0.0.1:1337/plugins/${pluginName}/reload`, { + method: 'POST', + credentials: 'include', + headers: { + Authentication: window.deckyAuthToken, + }, + }); + } catch (err) { + console.error('Error Reloading Plugin Backend', err); + } + + window.DeckyPluginLoader.importPlugin(pluginName, data?.version); + }} + > {t('PluginListIndex.reload')}