This commit is contained in:
Rafael 2022-03-15 14:42:39 -03:00 committed by Thomas Zarebczan
parent 93b70f5e92
commit 6ce9bd5cf7
7 changed files with 21 additions and 19 deletions

View file

@ -109,14 +109,15 @@ export default function FileRenderInitiator(props: Props) {
// Find out current channels status + active live claim // Find out current channels status + active live claim
React.useEffect(() => { React.useEffect(() => {
if (!channelClaimId || !isLivestreamClaim) return; // isCurrentClaimLive = already fetched
if (!channelClaimId || !isLivestreamClaim || isCurrentClaimLive) return;
const fetch = () => doFetchChannelLiveStatus(channelClaimId); const fetch = () => doFetchChannelLiveStatus(channelClaimId);
const intervalId = setInterval(fetch, LIVESTREAM_STATUS_CHECK_INTERVAL); const intervalId = setInterval(fetch, LIVESTREAM_STATUS_CHECK_INTERVAL);
return () => clearInterval(intervalId); return () => clearInterval(intervalId);
}, [channelClaimId, doFetchChannelLiveStatus, isLivestreamClaim]); }, [channelClaimId, doFetchChannelLiveStatus, isCurrentClaimLive, isLivestreamClaim]);
React.useEffect(() => { React.useEffect(() => {
if (!claimThumbnail) return; if (!claimThumbnail) return;

View file

@ -111,13 +111,18 @@ const findActiveStreams = async (
}; };
export const doFetchChannelLiveStatus = (channelId: string) => async (dispatch: Dispatch) => { export const doFetchChannelLiveStatus = (channelId: string) => async (dispatch: Dispatch) => {
const statusForId = `live-status-${channelId}`;
// const localStatus = window.localStorage.getItem(statusForId);
try { try {
const { channelStatus, channelData } = await fetchLiveChannel(channelId); const { channelStatus, channelData } = await fetchLiveChannel(channelId);
if (channelStatus === LiveStatus.NOT_LIVE) { if (channelStatus === LiveStatus.NOT_LIVE) {
dispatch({ type: ACTIONS.REMOVE_CHANNEL_FROM_ACTIVE_LIVESTREAMS, data: { channelId } }); dispatch({ type: ACTIONS.REMOVE_CHANNEL_FROM_ACTIVE_LIVESTREAMS, data: { channelId } });
window.localStorage.removeItem(statusForId);
return; return;
} }
if (channelStatus === LiveStatus.UNKNOWN) { if (channelStatus === LiveStatus.UNKNOWN) {
return; return;
} }
@ -130,8 +135,11 @@ export const doFetchChannelLiveStatus = (channelId: string) => async (dispatch:
channelData[channelId].claimUri = liveClaim.stream.canonical_url; channelData[channelId].claimUri = liveClaim.stream.canonical_url;
dispatch({ type: ACTIONS.ADD_CHANNEL_TO_ACTIVE_LIVESTREAMS, data: { ...channelData } }); dispatch({ type: ACTIONS.ADD_CHANNEL_TO_ACTIVE_LIVESTREAMS, data: { ...channelData } });
} }
window.localStorage.setItem(statusForId, channelStatus);
} catch (err) { } catch (err) {
dispatch({ type: ACTIONS.REMOVE_CHANNEL_FROM_ACTIVE_LIVESTREAMS, data: { channelId } }); dispatch({ type: ACTIONS.REMOVE_CHANNEL_FROM_ACTIVE_LIVESTREAMS, data: { channelId } });
window.localStorage.removeItem(statusForId);
} }
}; };

View file

@ -240,7 +240,6 @@
} }
&:after { &:after {
content: ''; content: '';
background: rgba(255, 255, 255, 0.5);
top: 0; top: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;

View file

@ -420,8 +420,8 @@
.file-viewer__embedded-header { .file-viewer__embedded-header {
position: absolute; position: absolute;
display: flex; display: grid;
justify-content: space-between; grid-template-columns: minmax(5rem, calc(100% - 7rem)) 1fr;
width: 100%; width: 100%;
top: 0; top: 0;
opacity: 1; opacity: 1;
@ -435,7 +435,7 @@
border-top-right-radius: var(--border-radius); border-top-right-radius: var(--border-radius);
.button { .button {
padding: var(--spacing-s); padding: var(--spacing-xxs);
color: var(--color-white); color: var(--color-white);
z-index: 2; z-index: 2;
@ -470,7 +470,6 @@
} }
.file-viewer__embedded-title { .file-viewer__embedded-title {
max-width: 75%;
z-index: 2; z-index: 2;
display: flex; display: flex;
align-items: center; align-items: center;
@ -479,13 +478,7 @@
} }
.file-viewer__embedded-info { .file-viewer__embedded-info {
display: flex; justify-self: flex-end;
align-items: center;
font-size: var(--font-small);
margin-left: var(--spacing-m);
white-space: nowrap;
position: relative;
overflow: hidden;
& > *:not(:last-child) { & > *:not(:last-child) {
margin-right: var(--spacing-s); margin-right: var(--spacing-s);

View file

@ -25,10 +25,6 @@ $recent-msg-button__height: 2rem;
} }
} }
@media (min-width: $breakpoint-large) {
margin-left: var(--spacing-l);
}
@media (min-width: $breakpoint-small) { @media (min-width: $breakpoint-small) {
top: calc(var(--header-height) + var(--spacing-m)) !important; top: calc(var(--header-height) + var(--spacing-m)) !important;
position: sticky; position: sticky;

View file

@ -578,8 +578,13 @@ body {
.main--livestream { .main--livestream {
@extend .main--file-page; @extend .main--file-page;
@media (min-width: 1750px) {
padding: 0;
}
.card-stack { .card-stack {
margin-bottom: var(--spacing-m); margin-bottom: var(--spacing-m);
@media (min-width: ($breakpoint-large + 300px)) { @media (min-width: ($breakpoint-large + 300px)) {
max-width: calc(var(--page-max-width--filepage) / 1.25); max-width: calc(var(--page-max-width--filepage) / 1.25);
margin-left: auto; margin-left: auto;
@ -608,6 +613,7 @@ body {
@media (max-width: $breakpoint-medium) { @media (max-width: $breakpoint-medium) {
padding: 0 var(--spacing-s); padding: 0 var(--spacing-s);
.card__main-actions { .card__main-actions {
.claim-preview__wrapper { .claim-preview__wrapper {
a { a {

View file

@ -210,7 +210,6 @@
.file-viewer__embedded-header { .file-viewer__embedded-header {
.file-viewer__embedded-title { .file-viewer__embedded-title {
width: calc(100% - 120px);
.button__label { .button__label {
display: inline-block; display: inline-block;
width: 100%; width: 100%;