diff options
Diffstat (limited to 'frontend/src/components/settings/pages/developer/index.tsx')
| -rw-r--r-- | frontend/src/components/settings/pages/developer/index.tsx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx index 200f13ab..3e6db2f7 100644 --- a/frontend/src/components/settings/pages/developer/index.tsx +++ b/frontend/src/components/settings/pages/developer/index.tsx @@ -13,26 +13,24 @@ import { useTranslation } from 'react-i18next'; import { FaFileArchive, FaLink, FaReact, FaSteamSymbol, FaTerminal } from 'react-icons/fa'; import { setShouldConnectToReactDevTools, setShowValveInternal } from '../../../../developer'; +import Logger from '../../../../logger'; import { installFromURL } from '../../../../store'; import { useSetting } from '../../../../utils/hooks/useSetting'; +import { getSetting } from '../../../../utils/settings'; import RemoteDebuggingSettings from '../general/RemoteDebugging'; -const installFromZip = () => { - window.DeckyPluginLoader.openFilePicker('/home/deck', true).then((val) => { +const logger = new Logger('DeveloperIndex'); + +const installFromZip = async () => { + const path = await getSetting<string>('user_info.user_home', ''); + if (path === '') { + logger.error('The default path has not been found!'); + return; + } + window.DeckyPluginLoader.openFilePicker(path, true, undefined, true, ['zip', 'rar'], false, true).then((val) => { const url = `file://${val.path}`; console.log(`Installing plugin locally from ${url}`); - - if (url.endsWith('.zip')) { - installFromURL(url); - } else { - window.DeckyPluginLoader.toaster.toast({ - //title: t('SettingsDeveloperIndex.toast_zip.title'), - title: 'Decky', - //body: t('SettingsDeveloperIndex.toast_zip.body'), - body: 'Installation failed! Only ZIP files are supported.', - onClick: installFromZip, - }); - } + installFromURL(url); }); }; |
