summaryrefslogtreecommitdiff
path: root/frontend/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/modals/MultiplePluginsInstallModal.tsx2
-rw-r--r--frontend/src/components/modals/PluginInstallModal.tsx2
-rw-r--r--frontend/src/components/modals/PluginUninstallModal.tsx2
-rw-r--r--frontend/src/components/modals/filepicker/index.tsx2
-rw-r--r--frontend/src/components/modals/filepicker/patches/library.ts4
-rw-r--r--frontend/src/components/settings/pages/developer/index.tsx26
-rw-r--r--frontend/src/components/settings/pages/general/BranchSelect.tsx4
-rw-r--r--frontend/src/components/settings/pages/general/NotificationSettings.tsx2
-rw-r--r--frontend/src/components/settings/pages/general/RemoteDebugging.tsx4
-rw-r--r--frontend/src/components/settings/pages/general/Updater.tsx10
-rw-r--r--frontend/src/components/settings/pages/plugin_list/index.tsx10
11 files changed, 28 insertions, 40 deletions
diff --git a/frontend/src/components/modals/MultiplePluginsInstallModal.tsx b/frontend/src/components/modals/MultiplePluginsInstallModal.tsx
index febdc38d..bfbff08c 100644
--- a/frontend/src/components/modals/MultiplePluginsInstallModal.tsx
+++ b/frontend/src/components/modals/MultiplePluginsInstallModal.tsx
@@ -46,7 +46,7 @@ const MultiplePluginsInstallModal: FC<MultiplePluginsInstallModalProps> = ({
setLoading(true);
await onOK();
setTimeout(() => Navigation.OpenQuickAccessMenu(QuickAccessTab.Decky), 250);
- setTimeout(() => window.DeckyPluginLoader.checkPluginUpdates(), 1000);
+ setTimeout(() => DeckyPluginLoader.checkPluginUpdates(), 1000);
}}
onCancel={async () => {
await onCancel();
diff --git a/frontend/src/components/modals/PluginInstallModal.tsx b/frontend/src/components/modals/PluginInstallModal.tsx
index b37dbc65..bf263b6d 100644
--- a/frontend/src/components/modals/PluginInstallModal.tsx
+++ b/frontend/src/components/modals/PluginInstallModal.tsx
@@ -34,7 +34,7 @@ const PluginInstallModal: FC<PluginInstallModalProps> = ({
setLoading(true);
await onOK();
setTimeout(() => Navigation.OpenQuickAccessMenu(QuickAccessTab.Decky), 250);
- setTimeout(() => window.DeckyPluginLoader.checkPluginUpdates(), 1000);
+ setTimeout(() => DeckyPluginLoader.checkPluginUpdates(), 1000);
}}
onCancel={async () => {
await onCancel();
diff --git a/frontend/src/components/modals/PluginUninstallModal.tsx b/frontend/src/components/modals/PluginUninstallModal.tsx
index e9c243b6..3fc0a71f 100644
--- a/frontend/src/components/modals/PluginUninstallModal.tsx
+++ b/frontend/src/components/modals/PluginUninstallModal.tsx
@@ -19,7 +19,7 @@ const PluginUninstallModal: FC<PluginUninstallModalProps> = ({ name, title, butt
await uninstallPlugin(name);
// uninstalling a plugin resets the hidden setting for it server-side
// we invalidate here so if you re-install it, you won't have an out-of-date hidden filter
- await window.DeckyPluginLoader.hiddenPluginsService.invalidate();
+ await DeckyPluginLoader.hiddenPluginsService.invalidate();
}}
strTitle={title}
strOKButtonText={buttonText}
diff --git a/frontend/src/components/modals/filepicker/index.tsx b/frontend/src/components/modals/filepicker/index.tsx
index 2dfa3ccd..2fbc800b 100644
--- a/frontend/src/components/modals/filepicker/index.tsx
+++ b/frontend/src/components/modals/filepicker/index.tsx
@@ -95,7 +95,7 @@ const sortOptions = [
},
];
-const getList = window.DeckyBackend.callable<
+const getList = DeckyBackend.callable<
[
path: string,
includeFiles?: boolean,
diff --git a/frontend/src/components/modals/filepicker/patches/library.ts b/frontend/src/components/modals/filepicker/patches/library.ts
index d398b83d..076e78f6 100644
--- a/frontend/src/components/modals/filepicker/patches/library.ts
+++ b/frontend/src/components/modals/filepicker/patches/library.ts
@@ -13,9 +13,7 @@ function rePatch() {
const details = window.appDetailsStore.GetAppDetails(appid);
logger.debug('game details', details);
// strShortcutStartDir
- const file = await window.DeckyPluginLoader.openFilePicker(
- details?.strShortcutStartDir.replaceAll('"', '') || '/',
- );
+ const file = await DeckyPluginLoader.openFilePicker(details?.strShortcutStartDir.replaceAll('"', '') || '/');
logger.debug('user selected', file);
window.SteamClient.Apps.SetShortcutExe(appid, JSON.stringify(file.path));
const pathArr = file.path.split('/');
diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx
index 36d3b5c0..9c8504e7 100644
--- a/frontend/src/components/settings/pages/developer/index.tsx
+++ b/frontend/src/components/settings/pages/developer/index.tsx
@@ -28,20 +28,13 @@ const installFromZip = async () => {
logger.error('The default path has not been found!');
return;
}
- window.DeckyPluginLoader.openFilePickerV2(
- FileSelectionType.FILE,
- path,
- true,
- true,
- undefined,
- ['zip'],
- false,
- false,
- ).then((val) => {
- const url = `file://${val.path}`;
- console.log(`Installing plugin locally from ${url}`);
- installFromURL(url);
- });
+ DeckyPluginLoader.openFilePickerV2(FileSelectionType.FILE, path, true, true, undefined, ['zip'], false, false).then(
+ (val) => {
+ const url = `file://${val.path}`;
+ console.log(`Installing plugin locally from ${url}`);
+ installFromURL(url);
+ },
+ );
};
export default function DeveloperSettings() {
@@ -92,10 +85,7 @@ export default function DeveloperSettings() {
<DialogButton
onClick={async () => {
try {
- let tabId = await window.DeckyBackend.call<[name: string], string>(
- 'utilities/get_tab_id',
- 'SharedJSContext',
- );
+ let tabId = await DeckyBackend.call<[name: string], string>('utilities/get_tab_id', 'SharedJSContext');
Navigation.NavigateToExternalWeb(
'localhost:8080/devtools/inspector.html?ws=localhost:8080/devtools/page/' + tabId,
);
diff --git a/frontend/src/components/settings/pages/general/BranchSelect.tsx b/frontend/src/components/settings/pages/general/BranchSelect.tsx
index 1af06823..6e69208a 100644
--- a/frontend/src/components/settings/pages/general/BranchSelect.tsx
+++ b/frontend/src/components/settings/pages/general/BranchSelect.tsx
@@ -3,7 +3,7 @@ import { FunctionComponent } from 'react';
import { useTranslation } from 'react-i18next';
import Logger from '../../../../logger';
-import { callUpdaterMethod } from '../../../../updater';
+import { checkForUpdates } from '../../../../updater';
import { useSetting } from '../../../../utils/hooks/useSetting';
const logger = new Logger('BranchSelect');
@@ -37,7 +37,7 @@ const BranchSelect: FunctionComponent<{}> = () => {
selectedOption={selectedBranch}
onChange={async (newVal) => {
await setSelectedBranch(newVal.data);
- callUpdaterMethod('check_for_updates');
+ checkForUpdates();
logger.log('switching branches!');
}}
/>
diff --git a/frontend/src/components/settings/pages/general/NotificationSettings.tsx b/frontend/src/components/settings/pages/general/NotificationSettings.tsx
index 21c2fd82..82f42e3b 100644
--- a/frontend/src/components/settings/pages/general/NotificationSettings.tsx
+++ b/frontend/src/components/settings/pages/general/NotificationSettings.tsx
@@ -6,7 +6,7 @@ import { useDeckyState } from '../../../DeckyState';
const NotificationSettings: FC = () => {
const { notificationSettings } = useDeckyState();
- const notificationService = window.DeckyPluginLoader.notificationService;
+ const notificationService = DeckyPluginLoader.notificationService;
const { t } = useTranslation();
diff --git a/frontend/src/components/settings/pages/general/RemoteDebugging.tsx b/frontend/src/components/settings/pages/general/RemoteDebugging.tsx
index 60e0e3c1..187f1cf4 100644
--- a/frontend/src/components/settings/pages/general/RemoteDebugging.tsx
+++ b/frontend/src/components/settings/pages/general/RemoteDebugging.tsx
@@ -18,8 +18,8 @@ export default function RemoteDebuggingSettings() {
value={allowRemoteDebugging || false}
onChange={(toggleValue) => {
setAllowRemoteDebugging(toggleValue);
- if (toggleValue) window.DeckyBackend.call('allow_remote_debugging');
- else window.DeckyBackend.call('disallow_remote_debugging');
+ if (toggleValue) DeckyBackend.call('allow_remote_debugging');
+ else DeckyBackend.call('disallow_remote_debugging');
}}
/>
</Field>
diff --git a/frontend/src/components/settings/pages/general/Updater.tsx b/frontend/src/components/settings/pages/general/Updater.tsx
index 927a99b0..26537b58 100644
--- a/frontend/src/components/settings/pages/general/Updater.tsx
+++ b/frontend/src/components/settings/pages/general/Updater.tsx
@@ -15,7 +15,7 @@ import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { FaExclamation } from 'react-icons/fa';
-import { VerInfo, callUpdaterMethod, finishUpdate } from '../../../../updater';
+import { VerInfo, checkForUpdates, doRestart, doUpdate } from '../../../../updater';
import { useDeckyState } from '../../../DeckyState';
import InlinePatchNotes from '../../../patchnotes/InlinePatchNotes';
import WithSuspense from '../../../WithSuspense';
@@ -85,7 +85,7 @@ export default function UpdaterSettings() {
finish: async () => {
setUpdateProgress(0);
setReloading(true);
- await finishUpdate();
+ await doRestart();
},
};
}, []);
@@ -122,13 +122,13 @@ export default function UpdaterSettings() {
!versionInfo?.remote || versionInfo?.remote?.tag_name == versionInfo?.current
? async () => {
setCheckingForUpdates(true);
- const res = (await callUpdaterMethod('check_for_updates')) as { result: VerInfo };
- setVersionInfo(res.result);
+ const verInfo = await checkForUpdates();
+ setVersionInfo(verInfo);
setCheckingForUpdates(false);
}
: async () => {
setUpdateProgress(0);
- callUpdaterMethod('do_update');
+ doUpdate();
}
}
>
diff --git a/frontend/src/components/settings/pages/plugin_list/index.tsx b/frontend/src/components/settings/pages/plugin_list/index.tsx
index 6475b40a..0728b12d 100644
--- a/frontend/src/components/settings/pages/plugin_list/index.tsx
+++ b/frontend/src/components/settings/pages/plugin_list/index.tsx
@@ -35,7 +35,7 @@ async function reinstallPlugin(pluginName: string, currentVersion?: string) {
type PluginTableData = PluginData & { name: string; hidden: boolean; onHide(): void; onShow(): void };
-const reloadPluginBackend = window.DeckyBackend.callable<[pluginName: string], void>('loader/reload_plugin');
+const reloadPluginBackend = DeckyBackend.callable<[pluginName: string], void>('loader/reload_plugin');
function PluginInteractables(props: { entry: ReorderableEntry<PluginTableData> }) {
const { t } = useTranslation();
@@ -58,14 +58,14 @@ function PluginInteractables(props: { entry: ReorderableEntry<PluginTableData> }
console.error('Error Reloading Plugin Backend', err);
}
- window.DeckyPluginLoader.importPlugin(name, version);
+ DeckyPluginLoader.importPlugin(name, version);
}}
>
{t('PluginListIndex.reload')}
</MenuItem>
<MenuItem
onSelected={() =>
- window.DeckyPluginLoader.uninstallPlugin(
+ DeckyPluginLoader.uninstallPlugin(
name,
t('PluginLoader.plugin_uninstall.title', { name }),
t('PluginLoader.plugin_uninstall.button'),
@@ -143,11 +143,11 @@ export default function PluginList() {
const { t } = useTranslation();
useEffect(() => {
- window.DeckyPluginLoader.checkPluginUpdates();
+ DeckyPluginLoader.checkPluginUpdates();
}, []);
const [pluginEntries, setPluginEntries] = useState<ReorderableEntry<PluginTableData>[]>([]);
- const hiddenPluginsService = window.DeckyPluginLoader.hiddenPluginsService;
+ const hiddenPluginsService = DeckyPluginLoader.hiddenPluginsService;
useEffect(() => {
setPluginEntries(