From 268fcd76f22f6ad87b193d748250354590a3e051 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Sun, 10 Jul 2022 11:55:23 +0300 Subject: [PATCH] StreamingServerWarning wrapped with model suspender --- .../StreamingServerWarning/StreamingServerWarning.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/StreamingServerWarning/StreamingServerWarning.js b/src/common/StreamingServerWarning/StreamingServerWarning.js index 3ffff03c4..9c6d7277a 100644 --- a/src/common/StreamingServerWarning/StreamingServerWarning.js +++ b/src/common/StreamingServerWarning/StreamingServerWarning.js @@ -6,6 +6,7 @@ const PropTypes = require('prop-types'); const classnames = require('classnames'); const Button = require('stremio/common/Button'); const useProfile = require('stremio/common/useProfile'); +const { withModelSuspender } = require('stremio/common/useModelState'); const styles = require('./styles'); const StreamingServerWarning = ({ className }) => { @@ -39,6 +40,12 @@ const StreamingServerWarning = ({ className }) => { } }); }, [profile.settings]); + + if (!isNaN(profile.settings.streamingServerWarningDismissed.getTime()) && + profile.settings.streamingServerWarningDismissed.getTime() > Date.now()) { + return null; + } + return (
Streaming server is not available.
@@ -56,4 +63,4 @@ StreamingServerWarning.propTypes = { className: PropTypes.string }; -module.exports = StreamingServerWarning; +module.exports = withModelSuspender(StreamingServerWarning);