mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 11:42:05 +00:00
Merge pull request #1082 from Stremio/fix/streaming-server-warning
Some checks are pending
Build / build (push) Waiting to run
Some checks are pending
Build / build (push) Waiting to run
Fix: Show Streaming Server warning correctly
This commit is contained in:
commit
4881f2c340
1 changed files with 5 additions and 6 deletions
|
|
@ -22,11 +22,10 @@ const Board = () => {
|
||||||
const profile = useProfile();
|
const profile = useProfile();
|
||||||
const boardCatalogsOffset = continueWatchingPreview.items.length > 0 ? 1 : 0;
|
const boardCatalogsOffset = continueWatchingPreview.items.length > 0 ? 1 : 0;
|
||||||
const scrollContainerRef = React.useRef();
|
const scrollContainerRef = React.useRef();
|
||||||
const streamingServerWarningDismissed = React.useMemo(() => {
|
const showStreamingServerWarning = React.useMemo(() => {
|
||||||
return streamingServer.settings !== null && streamingServer.settings.type === 'Ready' || (
|
return streamingServer.settings !== null && streamingServer.settings.type === 'Err' && (
|
||||||
!isNaN(profile.settings.streamingServerWarningDismissed.getTime()) &&
|
isNaN(profile.settings.streamingServerWarningDismissed.getTime()) ||
|
||||||
profile.settings.streamingServerWarningDismissed.getTime() > Date.now()
|
profile.settings.streamingServerWarningDismissed.getTime() < Date.now());
|
||||||
);
|
|
||||||
}, [profile.settings, streamingServer.settings]);
|
}, [profile.settings, streamingServer.settings]);
|
||||||
const onVisibleRangeChange = React.useCallback(() => {
|
const onVisibleRangeChange = React.useCallback(() => {
|
||||||
const range = getVisibleChildrenRange(scrollContainerRef.current);
|
const range = getVisibleChildrenRange(scrollContainerRef.current);
|
||||||
|
|
@ -103,7 +102,7 @@ const Board = () => {
|
||||||
</div>
|
</div>
|
||||||
</MainNavBars>
|
</MainNavBars>
|
||||||
{
|
{
|
||||||
!streamingServerWarningDismissed ?
|
showStreamingServerWarning ?
|
||||||
<StreamingServerWarning className={styles['board-warning-container']} />
|
<StreamingServerWarning className={styles['board-warning-container']} />
|
||||||
:
|
:
|
||||||
null
|
null
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue