diff options
| author | AAGaming <aagaming@riseup.net> | 2023-12-30 21:32:23 -0500 |
|---|---|---|
| committer | AAGaming <aagaming@riseup.net> | 2023-12-30 21:32:23 -0500 |
| commit | 40c7c1b515abf4abcecd6480afb28f27fb71d0f0 (patch) | |
| tree | 576399085651b6e7cb0c37876ed6c2b3d0452dd7 /frontend/src/components/settings/pages/general | |
| parent | 70104065e2145e9a04fef4ae28ec9875a6114e2d (diff) | |
| download | decky-loader-40c7c1b515abf4abcecd6480afb28f27fb71d0f0.tar.gz decky-loader-40c7c1b515abf4abcecd6480afb28f27fb71d0f0.zip | |
port updater to ws, also small refactoring
Diffstat (limited to 'frontend/src/components/settings/pages/general')
4 files changed, 10 insertions, 10 deletions
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(); } } > |
