mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
+2
-2
@@ -46,9 +46,9 @@ class PluginBrowser:
|
|||||||
for folder in listdir(self.plugin_path):
|
for folder in listdir(self.plugin_path):
|
||||||
with open(path.join(self.plugin_path, folder, 'plugin.json'), 'r') as f:
|
with open(path.join(self.plugin_path, folder, 'plugin.json'), 'r') as f:
|
||||||
plugin = json.load(f)
|
plugin = json.load(f)
|
||||||
|
|
||||||
if plugin['name'] == name:
|
if plugin['name'] == name:
|
||||||
return path.join(self.plugin_path, folder)
|
return path.join(self.plugin_path, folder)
|
||||||
|
|
||||||
async def uninstall_plugin(self, name):
|
async def uninstall_plugin(self, name):
|
||||||
tab = await get_tab("SP")
|
tab = await get_tab("SP")
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import { DialogButton, staticClasses } from 'decky-frontend-lib';
|
import { DialogButton, staticClasses } from 'decky-frontend-lib';
|
||||||
import { FaTrash } from 'react-icons/fa';
|
import { FaTrash } from 'react-icons/fa';
|
||||||
|
|
||||||
|
import { useDeckyState } from '../../DeckyState';
|
||||||
|
|
||||||
export default function PluginList() {
|
export default function PluginList() {
|
||||||
const plugins = window.DeckyPluginLoader?.getPlugins();
|
const { plugins } = useDeckyState();
|
||||||
|
|
||||||
if (plugins.length === 0) {
|
if (plugins.length === 0) {
|
||||||
return (
|
return (
|
||||||
@@ -14,7 +16,7 @@ export default function PluginList() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ul style={{ listStyleType: 'none' }}>
|
<ul style={{ listStyleType: 'none' }}>
|
||||||
{window.DeckyPluginLoader?.getPlugins().map(({ name }) => (
|
{plugins.map(({ name }) => (
|
||||||
<li style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
<li style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
||||||
<span>{name}</span>
|
<span>{name}</span>
|
||||||
<div className={staticClasses.Title} style={{ marginLeft: 'auto', boxShadow: 'none' }}>
|
<div className={staticClasses.Title} style={{ marginLeft: 'auto', boxShadow: 'none' }}>
|
||||||
|
|||||||
@@ -44,11 +44,13 @@ class PluginLoader extends Logger {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.routerHook.addRoute('/decky/store', () => <StorePage />);
|
this.routerHook.addRoute('/decky/store', () => <StorePage />);
|
||||||
this.routerHook.addRoute('/decky/settings', () => <SettingsPage />);
|
this.routerHook.addRoute('/decky/settings', () => {
|
||||||
}
|
return (
|
||||||
|
<DeckyStateContextProvider deckyState={this.deckyState}>
|
||||||
public getPlugins() {
|
<SettingsPage />
|
||||||
return this.plugins;
|
</DeckyStateContextProvider>
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public addPluginInstallPrompt(artifact: string, version: string, request_id: string, hash: string) {
|
public addPluginInstallPrompt(artifact: string, version: string, request_id: string, hash: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user