Skip to content

Commit

Permalink
Redo change render order
Browse files Browse the repository at this point in the history
  • Loading branch information
hanydd committed Dec 28, 2024
1 parent 54be660 commit 180da24
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/thumbnail-utils/thumbnails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ export async function labelThumbnail(
}
const [videoID] = videoIDs;

const category = await getVideoLabel(videoID);
if (!category) {
hideThumbnailLabel(thumbnail);
return null;
}

// 获取或创建缩略图标签
const { overlay, text } = await createOrGetThumbnail(thumbnail);

Expand All @@ -47,6 +41,12 @@ export async function labelThumbnail(
}
}

const category = await getVideoLabel(videoID);
if (!category) {
hideThumbnailLabel(thumbnail);
return null;
}

overlay.style.setProperty(
"--category-color",
`var(--sb-category-preview-${category}, var(--sb-category-${category}))`
Expand Down

0 comments on commit 180da24

Please sign in to comment.