diff options
| author | Marco Rodolfi <marco.rodolfi@tuta.io> | 2026-10-18 02:12:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-17 20:12:24 -0400 |
| commit | 82df584b461fe9a283b687ad9d883ea1cb8767a8 (patch) | |
| tree | ffd1d13d6d133402300d3615b70a30538c8c7ced /frontend/src/components/settings/pages/developer | |
| parent | 3c088117f0266852ec5ea780ff6f737dcfa9eab2 (diff) | |
| download | decky-loader-82df584b461fe9a283b687ad9d883ea1cb8767a8.tar.gz decky-loader-82df584b461fe9a283b687ad9d883ea1cb8767a8.zip | |
[Rebase] Warn users on possible risks on installing third party unvetted plugins (#676)
Co-authored-by: Marco Rodolfi <marco.rodolfi.1992@gmail.com>
Diffstat (limited to 'frontend/src/components/settings/pages/developer')
| -rw-r--r-- | frontend/src/components/settings/pages/developer/index.tsx | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx index 05989806..8691ff7b 100644 --- a/frontend/src/components/settings/pages/developer/index.tsx +++ b/frontend/src/components/settings/pages/developer/index.tsx @@ -7,6 +7,7 @@ import { Navigation, TextField, Toggle, + showModal, } from '@decky/ui'; import { useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -15,9 +16,11 @@ import { FaFileArchive, FaLink, FaReact, FaSteamSymbol, FaTerminal } from 'react import { setShouldConnectToReactDevTools, setShowValveInternal } from '../../../../developer'; import Logger from '../../../../logger'; import { installFromURL } from '../../../../store'; +import { WarnThirdPartyType } from '../../../../utils/globalTypes'; import { useSetting } from '../../../../utils/hooks/useSetting'; import { getSetting } from '../../../../utils/settings'; import { FileSelectionType } from '../../../modals/filepicker'; +import WarnThirdParty from '../../../modals/WarnThirdParty'; import RemoteDebuggingSettings from '../general/RemoteDebugging'; const logger = new Logger('DeveloperIndex'); @@ -43,6 +46,8 @@ export default function DeveloperSettings() { const [enableValveInternal, setEnableValveInternal] = useSetting<boolean>('developer.valve_internal', false); const [reactDevtoolsEnabled, setReactDevtoolsEnabled] = useSetting<boolean>('developer.rdt.enabled', false); const [reactDevtoolsIP, setReactDevtoolsIP] = useSetting<string>('developer.rdt.ip', ''); + const [acceptedWarning, setAcceptedWarning] = useSetting<boolean>('developer.warn.third_party', false); + const waitTime = acceptedWarning ? 0 : 5; const [pluginURL, setPluginURL] = useState(''); const textRef = useRef<HTMLDivElement>(null); const { t } = useTranslation(); @@ -74,13 +79,23 @@ export default function DeveloperSettings() { > <DialogButton disabled={pluginURL.length == 0} - onClick={() => { - if (/^https?:\/\//.test(pluginURL)) { - installFromURL(pluginURL); - } else { - installFromURL('https://' + pluginURL); - } - }} + onClick={() => + showModal( + <WarnThirdParty + type={WarnThirdPartyType.ZIP} + onOK={() => { + setAcceptedWarning(true); + if (/^https?:\/\//.test(pluginURL)) { + installFromURL(pluginURL); + } else { + installFromURL('https://' + pluginURL); + } + }} + onCancel={() => {}} + seconds={waitTime} + />, + ) + } > {t('SettingsDeveloperIndex.third_party_plugins.button_install')} </DialogButton> |
