From d0ee4e40cc8bed3f35b7766a7f02bc55e49a8d61 Mon Sep 17 00:00:00 2001 From: Salief Date: Sun, 2 Jun 2024 12:59:15 -0400 Subject: [PATCH 1/5] rm nullifier from channel card --- apps/site/components/server/ChannelCard.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/site/components/server/ChannelCard.tsx b/apps/site/components/server/ChannelCard.tsx index a7d1a854..db24ec3a 100644 --- a/apps/site/components/server/ChannelCard.tsx +++ b/apps/site/components/server/ChannelCard.tsx @@ -32,8 +32,6 @@ export async function ChannelCard({ channel?.adds?.items ?? [] ).find((item) => !item.removed) - if (!lastNonRemovedItem) return null - // Access the metadata of the most recent non-removed item and update with Mux processing status if it's a video const channelCardMetadata = await kv.get< Pick['value'] From 363fa4e15dc799b6262e2eddfa4d4fa7e579903d Mon Sep 17 00:00:00 2001 From: Salief Date: Sun, 2 Jun 2024 13:37:33 -0400 Subject: [PATCH 2/5] update conditional logic for channels with no items on profile page --- apps/site/components/server/ChannelCard.tsx | 51 +++++++++++++++------ 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/apps/site/components/server/ChannelCard.tsx b/apps/site/components/server/ChannelCard.tsx index db24ec3a..30f43f4e 100644 --- a/apps/site/components/server/ChannelCard.tsx +++ b/apps/site/components/server/ChannelCard.tsx @@ -32,19 +32,25 @@ export async function ChannelCard({ channel?.adds?.items ?? [] ).find((item) => !item.removed) - // Access the metadata of the most recent non-removed item and update with Mux processing status if it's a video - const channelCardMetadata = await kv.get< - Pick['value'] - >(lastNonRemovedItem?.item.uri as string) - if ( - channelCardMetadata && - isVideo({ mimeType: channelCardMetadata.contentType }) - ) { - if (muxClient) { - const { status } = await muxClient.video.assets.retrieve( - channelCardMetadata?.muxAssetId as string, - ) - channelCardMetadata.muxAssetStatus = status + let channelCardMetadata + + if (lastNonRemovedItem) { + // Retrieve metadata only if there is a non-removed item + channelCardMetadata = await kv.get< + Pick['value'] + >(lastNonRemovedItem.item.uri as string) + + // Update with Mux processing status if it's a video + if ( + channelCardMetadata && + isVideo({ mimeType: channelCardMetadata.contentType }) + ) { + if (muxClient) { + const { status } = await muxClient.video.assets.retrieve( + channelCardMetadata.muxAssetId as string, + ) + channelCardMetadata.muxAssetStatus = status + } } } @@ -92,6 +98,24 @@ export async function ChannelCard({ width={width} height={width} /> + ) : !lastNonRemovedItem ? ( + + + No items + + ) : ( )} + {/* Channel name & creator */} Date: Sun, 2 Jun 2024 13:47:07 -0400 Subject: [PATCH 3/5] update sizing for no items comp --- apps/site/components/server/ChannelCard.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/site/components/server/ChannelCard.tsx b/apps/site/components/server/ChannelCard.tsx index 30f43f4e..1ebb6736 100644 --- a/apps/site/components/server/ChannelCard.tsx +++ b/apps/site/components/server/ChannelCard.tsx @@ -100,13 +100,9 @@ export async function ChannelCard({ /> ) : !lastNonRemovedItem ? ( Date: Sun, 2 Jun 2024 13:54:02 -0400 Subject: [PATCH 4/5] update size of no items text in add to channel dialog --- apps/site/components/client/ChannelCard2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/site/components/client/ChannelCard2.tsx b/apps/site/components/client/ChannelCard2.tsx index f7ceffbd..715337bc 100644 --- a/apps/site/components/client/ChannelCard2.tsx +++ b/apps/site/components/client/ChannelCard2.tsx @@ -63,7 +63,7 @@ export function ChannelCard2({ /> ) : ( - + No items From a3fc045f16b1b926c15b19d0144a4797f608e482 Mon Sep 17 00:00:00 2001 From: Salief Date: Sun, 2 Jun 2024 13:59:48 -0400 Subject: [PATCH 5/5] adjust text size again --- apps/site/components/client/ChannelCard2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/site/components/client/ChannelCard2.tsx b/apps/site/components/client/ChannelCard2.tsx index 715337bc..a25bbec3 100644 --- a/apps/site/components/client/ChannelCard2.tsx +++ b/apps/site/components/client/ChannelCard2.tsx @@ -63,7 +63,7 @@ export function ChannelCard2({ /> ) : ( - + No items