From a2eca60e4561858eec093489e8633bfbe6602312 Mon Sep 17 00:00:00 2001 From: Felipe Pontes Date: Thu, 10 Aug 2023 17:15:21 -0300 Subject: [PATCH] feat: Reload streming server after update --- src/App/DefaultSettingsHandler.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/App/DefaultSettingsHandler.js b/src/App/DefaultSettingsHandler.js index e47f93431..42cc8165d 100644 --- a/src/App/DefaultSettingsHandler.js +++ b/src/App/DefaultSettingsHandler.js @@ -6,16 +6,27 @@ const { useProfile, } = require('stremio/common'); const useProfileSettingsInputs = require('stremio/routes/Settings/useProfileSettingsInputs'); +const { useServices } = require('stremio/services'); const DefaultSettingsHandler = () => { + const { core } = useServices(); + const profile = useProfile(); const { streamingServerUrlInput } = useProfileSettingsInputs(profile); - React.useLayoutEffect(() => { + React.useEffect(() => { const searchParams = new URLSearchParams(window.location.search); if (searchParams.has('streamingServerUrl')) { streamingServerUrlInput.onChange(searchParams.get('streamingServerUrl')); + setTimeout(() => { + core.transport.dispatch({ + action: 'StreamingServer', + args: { + action: 'Reload' + } + }); + }, 2000); } }, []);