diff --git a/package-lock.json b/package-lock.json index b5d8bcef8..275f9aa31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@babel/runtime": "7.16.0", "@sentry/browser": "6.13.3", "@stremio/stremio-colors": "5.0.1", - "@stremio/stremio-core-web": "0.44.8", + "@stremio/stremio-core-web": "0.44.10", "@stremio/stremio-icons": "4.0.0", "@stremio/stremio-video": "0.0.24", "a-color-picker": "1.2.1", @@ -2699,9 +2699,9 @@ "integrity": "sha512-Dt3PYmy1DZ473QNs99KYXVWQPHtpIl37VUY0+gCEvvuCqE1fRrZIJtZ9KbysUKonvO7WwdQDztgcW0iGoc1dEA==" }, "node_modules/@stremio/stremio-core-web": { - "version": "0.44.8", - "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.8.tgz", - "integrity": "sha512-c7ARfOxf0yy73b6sZauCLPUjpNYacF9tZXW7bxxg18IBGv7kXDBvLnk1rc54XKhJfHRgAPJuY5I1ijA0bM4nBQ==", + "version": "0.44.10", + "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.10.tgz", + "integrity": "sha512-+AUJ3d5u5SH64lcuQIAtXPfeIaWzSNfdDL92HECXP29qat2TtCyM+ENLhTuMZzrbInD22SQrRhfIS3T8nFVQYg==", "dependencies": { "@babel/runtime": "7.16.0" } @@ -16716,9 +16716,9 @@ "integrity": "sha512-Dt3PYmy1DZ473QNs99KYXVWQPHtpIl37VUY0+gCEvvuCqE1fRrZIJtZ9KbysUKonvO7WwdQDztgcW0iGoc1dEA==" }, "@stremio/stremio-core-web": { - "version": "0.44.8", - "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.8.tgz", - "integrity": "sha512-c7ARfOxf0yy73b6sZauCLPUjpNYacF9tZXW7bxxg18IBGv7kXDBvLnk1rc54XKhJfHRgAPJuY5I1ijA0bM4nBQ==", + "version": "0.44.10", + "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.44.10.tgz", + "integrity": "sha512-+AUJ3d5u5SH64lcuQIAtXPfeIaWzSNfdDL92HECXP29qat2TtCyM+ENLhTuMZzrbInD22SQrRhfIS3T8nFVQYg==", "requires": { "@babel/runtime": "7.16.0" } diff --git a/package.json b/package.json index b998ad00e..6aff4873d 100755 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@babel/runtime": "7.16.0", "@sentry/browser": "6.13.3", "@stremio/stremio-colors": "5.0.1", - "@stremio/stremio-core-web": "0.44.8", + "@stremio/stremio-core-web": "0.44.10", "@stremio/stremio-icons": "4.0.0", "@stremio/stremio-video": "0.0.24", "a-color-picker": "1.2.1", diff --git a/src/routes/Settings/Settings.js b/src/routes/Settings/Settings.js index 3b99b20fb..c90b7150e 100644 --- a/src/routes/Settings/Settings.js +++ b/src/routes/Settings/Settings.js @@ -9,6 +9,7 @@ const { useServices } = require('stremio/services'); const { Button, Checkbox, MainNavBars, Multiselect, ColorInput, TextInput, ModalDialog, useProfile, useStreamingServer, useBinaryState, withCoreSuspender } = require('stremio/common'); const useProfileSettingsInputs = require('./useProfileSettingsInputs'); const useStreamingServerSettingsInputs = require('./useStreamingServerSettingsInputs'); +const useDataExport = require('./useDataExport'); const styles = require('./styles'); const GENERAL_SECTION = 'general'; @@ -20,6 +21,7 @@ const Settings = () => { const { core } = useServices(); const { routeFocused } = useRouteFocused(); const profile = useProfile(); + const [dataExport, loadDataExport] = useDataExport(); const streamingServer = useStreamingServer(); const { interfaceLanguageSelect, @@ -82,7 +84,7 @@ const Settings = () => { // TODO }, []); const exportDataOnClick = React.useCallback(() => { - // TODO + loadDataExport(); }, []); const reloadStreamingServer = React.useCallback(() => { core.transport.dispatch({ @@ -128,6 +130,11 @@ const Settings = () => { const sectionsContainerOnScorll = React.useCallback(throttle(() => { updateSelectedSectionId(); }, 50), []); + React.useEffect(() => { + if (dataExport.exportUrl !== null && typeof dataExport.exportUrl === 'string') { + window.open(dataExport.exportUrl); + } + }, [dataExport.exportUrl]); React.useLayoutEffect(() => { if (routeFocused) { updateSelectedSectionId(); @@ -240,7 +247,7 @@ const Settings = () => {