feat: add media save guide

This commit is contained in:
TerryM
2026-06-01 23:00:28 +08:00
parent 7b48f9780c
commit e096d59fa6
16 changed files with 437 additions and 102 deletions

View File

@@ -22,6 +22,7 @@ import { formatDateYmd } from "../utils/format";
import { postToResource } from "../utils/postResourceAdapter";
import type { Post } from "../types/post";
import { downloadAttachment } from "./messageStream/utils/downloadFile";
import { mediaSaveKindFromType, useSaveToAlbumGuide } from "./SaveToAlbumGuide";
import { useToast } from "./Toast";
const MEDALS = ["🥇", "🥈", "🥉"];
@@ -94,6 +95,7 @@ function PopularRankRow({
const navigate = useNavigate();
const lp = useLocalizedPath();
const { showToast } = useToast();
const { showSaveToAlbumGuide } = useSaveToAlbumGuide();
const [isDownloading, setIsDownloading] = useState(false);
const [coverFailed, setCoverFailed] = useState(false);
@@ -110,6 +112,8 @@ function PopularRankRow({
r.downloadAttachmentId,
r.title,
);
const mediaKind = mediaSaveKindFromType(r.type);
if (mediaKind) showSaveToAlbumGuide(mediaKind);
} catch {
showToast(t("downloadFail"), "error");
} finally {