summaryrefslogtreecommitdiff
path: root/frontend/src/plugin-loader.tsx
diff options
context:
space:
mode:
authorAAGaming <aa@mail.catvibers.me>2022-10-15 23:46:42 -0400
committerGitHub <noreply@github.com>2022-10-15 20:46:42 -0700
commit6e3c05072cb507e2a376b7019836bea7bf663cb0 (patch)
tree6171eb40ba1a76e1e2b24f8cac8545114a5ad4ef /frontend/src/plugin-loader.tsx
parent9b405e4bdc6ead86d69ad8f54af89a8d5b484f08 (diff)
downloaddecky-loader-b9389e342bcd5a3df867f811450f13b3a8438d5b.tar.gz
decky-loader-b9389e342bcd5a3df867f811450f13b3a8438d5b.zip
Developer menu (#211)v2.3.0-pre1
* add settings utils to use settings outside of components * initial implementation of developer menu * ✨ Add support for addScriptToEvaluateOnNewDocument * React DevTools support * increase chance of RDT successfully injecting * Rewrite toaster hook to not re-create the window * remove friends focus workaround because it's fixed * Expose various DFL utilities as DFL in dev mode * try to fix text field focuss * move focusable to outside field * add onTouchEnd and onClick to focusable * Update pnpm-lock.yaml Co-authored-by: FinalDoom <7464170-FinalDoom@users.noreply.gitlab.com> Co-authored-by: TrainDoctor <traindoctor@protonmail.com>
Diffstat (limited to 'frontend/src/plugin-loader.tsx')
-rw-r--r--frontend/src/plugin-loader.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx
index 6eee9bc0..400e7484 100644
--- a/frontend/src/plugin-loader.tsx
+++ b/frontend/src/plugin-loader.tsx
@@ -25,6 +25,7 @@ import { checkForUpdates } from './store';
import TabsHook from './tabs-hook';
import Toaster from './toaster';
import { VerInfo, callUpdaterMethod } from './updater';
+import { getSetting } from './utils/settings';
const StorePage = lazy(() => import('./components/store/Store'));
const SettingsPage = lazy(() => import('./components/settings'));
@@ -40,7 +41,7 @@ class PluginLoader extends Logger {
private tabsHook: TabsHook = new TabsHook();
// private windowHook: WindowHook = new WindowHook();
private routerHook: RouterHook = new RouterHook();
- private toaster: Toaster = new Toaster();
+ public toaster: Toaster = new Toaster();
private deckyState: DeckyState = new DeckyState();
private reloadLock: boolean = false;
@@ -172,6 +173,12 @@ class PluginLoader extends Logger {
}
}
+ public init() {
+ getSetting('developer.enabled', false).then((val) => {
+ if (val) import('./developer').then((developer) => developer.startup());
+ });
+ }
+
public deinit() {
this.routerHook.removeRoute('/decky/store');
this.routerHook.removeRoute('/decky/settings');