feat: add media save guide
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user