mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-13 00:53:46 +03:00
Plugin backend reload (#463)
Co-authored-by: beebls <102569435+beebls@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8049417e03
commit
2e8e0fc7c1
@@ -44,7 +44,23 @@ function PluginInteractables(props: { entry: ReorderableEntry<PluginData> }) {
|
||||
const showCtxMenu = (e: MouseEvent | GamepadEvent) => {
|
||||
showContextMenu(
|
||||
<Menu label={t('PluginListIndex.plugin_actions')}>
|
||||
<MenuItem onSelected={() => window.DeckyPluginLoader.importPlugin(pluginName, data?.version)}>
|
||||
<MenuItem
|
||||
onSelected={() => {
|
||||
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')}
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
|
||||
Reference in New Issue
Block a user