From 085aacea068dccda170045715ee41dfbfbf44f00 Mon Sep 17 00:00:00 2001
From: botato <63275405+botatooo@users.noreply.github.com>
Date: Sun, 3 Jul 2022 02:14:43 +0000
Subject: Use deckyState in uninstall menu (fixes #98) (#100)

---
 frontend/src/components/settings/pages/PluginList.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'frontend/src/components/settings/pages/PluginList.tsx')

diff --git a/frontend/src/components/settings/pages/PluginList.tsx b/frontend/src/components/settings/pages/PluginList.tsx
index 4fd2c063..bf01f85a 100644
--- a/frontend/src/components/settings/pages/PluginList.tsx
+++ b/frontend/src/components/settings/pages/PluginList.tsx
@@ -1,8 +1,10 @@
 import { DialogButton, staticClasses } from 'decky-frontend-lib';
 import { FaTrash } from 'react-icons/fa';
 
+import { useDeckyState } from '../../DeckyState';
+
 export default function PluginList() {
-  const plugins = window.DeckyPluginLoader?.getPlugins();
+  const { plugins } = useDeckyState();
 
   if (plugins.length === 0) {
     return (
@@ -14,7 +16,7 @@ export default function PluginList() {
 
   return (
     <ul style={{ listStyleType: 'none' }}>
-      {window.DeckyPluginLoader?.getPlugins().map(({ name }) => (
+      {plugins.map(({ name }) => (
         <li style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
           <span>{name}</span>
           <div className={staticClasses.Title} style={{ marginLeft: 'auto', boxShadow: 'none' }}>
-- 
cgit v1.2.3

