diff --git a/src/App/App.js b/src/App/App.js index 77a4b5824..5be4754b7 100644 --- a/src/App/App.js +++ b/src/App/App.js @@ -9,6 +9,7 @@ const { NotFound } = require('stremio/routes'); const { ToastProvider, CONSTANTS } = require('stremio/common'); const ServicesToaster = require('./ServicesToaster'); const DeepLinkHandler = require('./DeepLinkHandler'); +const DefaultSettingsHandler = require('./DefaultSettingsHandler'); const ErrorDialog = require('./ErrorDialog'); const routerViewsConfig = require('./routerViewsConfig'); const styles = require('./styles'); @@ -152,6 +153,7 @@ const App = () => { + { + const profile = useProfile(); + + const { streamingServerUrlInput } = useProfileSettingsInputs(profile); + + React.useLayoutEffect(() => { + const searchParams = new URLSearchParams(window.location.search); + if (searchParams.has('streamingServerUrl')) { + streamingServerUrlInput.onChange(searchParams.get('streamingServerUrl')); + } + }, []); + + return null; +}; + +module.exports = withCoreSuspender(DefaultSettingsHandler);