From 30d7c9bb812e253c09f563f3f9b5022a3364f636 Mon Sep 17 00:00:00 2001
From: AAGaming <aa@mail.catvibers.me>
Date: Sun, 18 Jun 2023 17:27:23 -0400
Subject: fix: fix blank plugins

this is why i shouldn't program at night
---
 frontend/src/components/QuickAccessVisibleState.tsx | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

(limited to 'frontend/src/components/QuickAccessVisibleState.tsx')

diff --git a/frontend/src/components/QuickAccessVisibleState.tsx b/frontend/src/components/QuickAccessVisibleState.tsx
index ef977442..1bfe0e65 100644
--- a/frontend/src/components/QuickAccessVisibleState.tsx
+++ b/frontend/src/components/QuickAccessVisibleState.tsx
@@ -1,17 +1,16 @@
 import { FC, createContext, useContext, useState } from 'react';
 
-const QuickAccessVisibleState = createContext<boolean>(true);
+const QuickAccessVisibleState = createContext<boolean>(false);
 
 export const useQuickAccessVisible = () => useContext(QuickAccessVisibleState);
 
-export const QuickAccessVisibleStateProvider: FC<{ initial: boolean; tab: any }> = ({ children, initial, tab }) => {
+export const QuickAccessVisibleStateProvider: FC<{ tab: any }> = ({ children, tab }) => {
+  const initial = tab.initialVisibility;
   const [visible, setVisible] = useState<boolean>(initial);
-  const [prev, setPrev] = useState<boolean>(initial);
   // HACK but i can't think of a better way to do this
-  tab.qAMVisibilitySetter = setVisible;
-  if (initial != prev) {
-    setPrev(initial);
-    setVisible(initial);
-  }
+  tab.qAMVisibilitySetter = (val: boolean) => {
+    if (val != visible) setVisible(val);
+  };
+
   return <QuickAccessVisibleState.Provider value={visible}>{children}</QuickAccessVisibleState.Provider>;
 };
-- 
cgit v1.2.3

