From 05f9a3b7b78f894d00406395f1a179af87c6d894 Mon Sep 17 00:00:00 2001 From: Marco Rodolfi Date: Wed, 13 Mar 2024 16:12:56 +0100 Subject: [PATCH] Added a wait time only for the first popup message on both warnings. --- frontend/src/components/settings/pages/developer/index.tsx | 4 ++++ .../src/components/settings/pages/general/StoreSelect.tsx | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx index b6e5c18fe..2b172b4bb 100644 --- a/frontend/src/components/settings/pages/developer/index.tsx +++ b/frontend/src/components/settings/pages/developer/index.tsx @@ -50,6 +50,8 @@ export default function DeveloperSettings() { const [enableValveInternal, setEnableValveInternal] = useSetting('developer.valve_internal', false); const [reactDevtoolsEnabled, setReactDevtoolsEnabled] = useSetting('developer.rdt.enabled', false); const [reactDevtoolsIP, setReactDevtoolsIP] = useSetting('developer.rdt.ip', ''); + const [acceptedWarning, setAcceptedWarning] = useSetting('developer.warn.third_party', false); + const waitTime = acceptedWarning ? 0 : 5; const [pluginURL, setPluginURL] = useState(''); const textRef = useRef(null); const { t } = useTranslation(); @@ -86,9 +88,11 @@ export default function DeveloperSettings() { { + setAcceptedWarning(true); installFromURL(pluginURL); }} onCancel={() => {}} + seconds={waitTime} />, ) } diff --git a/frontend/src/components/settings/pages/general/StoreSelect.tsx b/frontend/src/components/settings/pages/general/StoreSelect.tsx index 4a04638c0..1b444e4df 100644 --- a/frontend/src/components/settings/pages/general/StoreSelect.tsx +++ b/frontend/src/components/settings/pages/general/StoreSelect.tsx @@ -13,6 +13,8 @@ const logger = new Logger('StoreSelect'); const StoreSelect: FunctionComponent<{}> = () => { const [selectedStore, setSelectedStore] = useSetting('store', Store.Default); const [selectedStoreURL, setSelectedStoreURL] = useSetting('store-url', null); + const [acceptedWarning, setAcceptedWarning] = useSetting('store_select.warn.third_party', false); + const waitTime = acceptedWarning ? 0 : 5; const { t } = useTranslation(); const tStores = [ t('StoreSelect.store_channel.default'), @@ -43,7 +45,10 @@ const StoreSelect: FunctionComponent<{}> = () => { showModal( {}} + seconds={waitTime} + onOK={() => { + setAcceptedWarning(true); + }} onCancel={() => setSelectedStore(Store.Default)} />, ) && (