From 8b69968b8fa2af074ea8484734c0597b8e803467 Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 11 Nov 2024 14:57:49 +0800 Subject: [PATCH 1/2] MediaAttachmentGrid: fix element type misuse --- src/timelines/MediaAttachmentGrid.tsx | 32 +++++++++++++-------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/timelines/MediaAttachmentGrid.tsx b/src/timelines/MediaAttachmentGrid.tsx index 625e0ab..682767a 100644 --- a/src/timelines/MediaAttachmentGrid.tsx +++ b/src/timelines/MediaAttachmentGrid.tsx @@ -3,6 +3,8 @@ import { type Component, For, Index, + Match, + Switch, createMemo, createRenderEffect, createSignal, @@ -147,9 +149,10 @@ const MediaAttachmentGrid: Component<{ > {(item, index) => { - switch (item().type) { - case "image": - return ( + const itemType = () => item().type; + return ( + + - ); - case "video": - return ( + + + + - ); - case "unknown": - return
; - } +
+
+ ); }}
From c372ea4a92b9b44598b7d2a63123425b5eabfe89 Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 11 Nov 2024 15:06:48 +0800 Subject: [PATCH 2/2] depoly: try use inline env var --- .forgejo/workflows/depoly.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/depoly.yml b/.forgejo/workflows/depoly.yml index b541fa0..9ae7044 100644 --- a/.forgejo/workflows/depoly.yml +++ b/.forgejo/workflows/depoly.yml @@ -31,16 +31,12 @@ jobs: run: bun install - name: Build Dist (Staging) - run: bun dist -m staging + run: VITE_CODE_VERSION=$GITHUB_SHA bun dist -m staging if: env.GITHUB_REF_NAME == 'master' - env: - VITE_CODE_VERSION: ${{ env.GITHUB_SHA }} - name: Build Dist - run: bun dist + run: VITE_CODE_VERSION=$GITHUB_SHA bun dist if: env.GITHUB_REF_NAME != 'master' - env: - VITE_CODE_VERSION: ${{ env.GITHUB_SHA }} - name: Depoly to Preview uses: https://github.com/cloudflare/wrangler-action@v3