fix: keep video downloads visible while playing
This commit is contained in:
@@ -16,6 +16,7 @@ export type PostStreamParams = {
|
||||
language?: string;
|
||||
q?: string;
|
||||
sort?: string;
|
||||
tag?: string;
|
||||
lang: Lang;
|
||||
};
|
||||
|
||||
@@ -60,6 +61,9 @@ function filterMock(params: PostStreamParams): Post[] {
|
||||
return false;
|
||||
const q = params.q?.trim().toLowerCase();
|
||||
if (params.language && p.language !== params.language) return false;
|
||||
const tag = params.tag?.trim().toLowerCase();
|
||||
if (tag && !(p.tags ?? []).some((t) => t.toLowerCase() === tag))
|
||||
return false;
|
||||
if (q) {
|
||||
const haystack = [
|
||||
p.text ?? "",
|
||||
@@ -89,6 +93,7 @@ function buildRealUrl(params: PostStreamParams, cursor?: string): string {
|
||||
if (params.scope.kind === "category") sp.set("category", params.scope.slug);
|
||||
if (params.type && params.type !== "all") sp.set("type", params.type);
|
||||
if (params.sort) sp.set("sort", params.sort);
|
||||
if (params.tag) sp.set("tag", params.tag);
|
||||
if (params.language) sp.set("language", sourceLanguageQuery(params.language));
|
||||
if (cursor) sp.set("cursor", cursor);
|
||||
return `${q ? "/api/posts/search" : "/api/posts"}?${sp.toString()}`;
|
||||
@@ -166,6 +171,7 @@ export function usePostStream(params: PostStreamParams): PostStreamResult {
|
||||
params.language,
|
||||
params.q,
|
||||
params.sort,
|
||||
params.tag,
|
||||
params.lang,
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user