From fb7963c09e37d2e9c70cd4fb2030be901ba8a66b Mon Sep 17 00:00:00 2001 From: Felipe Pontes Date: Thu, 10 Aug 2023 17:27:23 -0300 Subject: [PATCH] feat: Show toast notification --- src/App/DefaultSettingsHandler.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/App/DefaultSettingsHandler.js b/src/App/DefaultSettingsHandler.js index 47bc329e9..c963db130 100644 --- a/src/App/DefaultSettingsHandler.js +++ b/src/App/DefaultSettingsHandler.js @@ -4,24 +4,28 @@ const React = require('react'); const { withCoreSuspender, useProfile, + useToast, } = require('stremio/common'); const { useServices } = require('stremio/services'); const DefaultSettingsHandler = () => { const { core } = useServices(); + const toast = useToast(); const profile = useProfile(); React.useEffect(() => { const searchParams = new URLSearchParams(window.location.search); if (searchParams.has('streamingServerUrl')) { + const streamingServerUrl = searchParams.get('streamingServerUrl'); + core.transport.dispatch({ action: 'Ctx', args: { action: 'UpdateSettings', args: { ...profile.settings, - streamingServerUrl: searchParams.get('streamingServerUrl') + streamingServerUrl } } }); @@ -33,6 +37,11 @@ const DefaultSettingsHandler = () => { } }); }, 1000); + toast.show({ + type: 'info', + title: `Using streaming server at ${streamingServerUrl}`, + timeout: 4000 + }); } }, []);