Skip to content

Commit

Permalink
Added a wait time only for the first popup message on both warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
RodoMa92 committed Mar 13, 2024
1 parent a1b4040 commit 05f9a3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions frontend/src/components/settings/pages/developer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,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();
Expand Down Expand Up @@ -86,9 +88,11 @@ export default function DeveloperSettings() {
<WarnThirdParty
type={WarnThirdPartyType.ZIP}
onOK={() => {
setAcceptedWarning(true);
installFromURL(pluginURL);
}}
onCancel={() => {}}
seconds={waitTime}
/>,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const logger = new Logger('StoreSelect');
const StoreSelect: FunctionComponent<{}> = () => {
const [selectedStore, setSelectedStore] = useSetting<Store>('store', Store.Default);
const [selectedStoreURL, setSelectedStoreURL] = useSetting<string | null>('store-url', null);
const [acceptedWarning, setAcceptedWarning] = useSetting<boolean>('store_select.warn.third_party', false);
const waitTime = acceptedWarning ? 0 : 5;
const { t } = useTranslation();
const tStores = [
t('StoreSelect.store_channel.default'),
Expand Down Expand Up @@ -43,7 +45,10 @@ const StoreSelect: FunctionComponent<{}> = () => {
showModal(
<WarnThirdParty
type={WarnThirdPartyType.REPO}
onOK={() => {}}
seconds={waitTime}
onOK={() => {
setAcceptedWarning(true);
}}
onCancel={() => setSelectedStore(Store.Default)}
/>,
) && (
Expand Down

0 comments on commit 05f9a3b

Please sign in to comment.