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

@@ -13,6 +13,7 @@ import {
downloadAttachment,
downloadFile,
} from "./messageStream/utils/downloadFile";
import { mediaSaveKindFromType, useSaveToAlbumGuide } from "./SaveToAlbumGuide";
import { useToast } from "./Toast";
function isPlaceholderAsset(path: string | undefined | null) {
@@ -52,6 +53,7 @@ export function RecommendedCard({
const { t } = useI18n();
const lp = useLocalizedPath();
const { showToast } = useToast();
const { showSaveToAlbumGuide } = useSaveToAlbumGuide();
const [isDownloading, setIsDownloading] = useState(false);
const figmaCover =
officialRecommendationCoverFallbacks[
@@ -87,6 +89,8 @@ export function RecommendedCard({
} else {
await downloadFile(dl, displayTitle);
}
const mediaKind = mediaSaveKindFromType(r.type);
if (mediaKind) showSaveToAlbumGuide(mediaKind);
} catch {
showToast(t("downloadFail"), "error");
} finally {