feat: 启动报错
This commit is contained in:
parent
a0821fc996
commit
e6e77f0199
@ -82,7 +82,7 @@ const MessageItem = ({ setCancel, cancel = true, t, insets, item, sessionId, set
|
||||
onPress: () => {
|
||||
const imageUrl = image?.preview_file_info?.url || image.video?.preview_file_info?.url;
|
||||
if (imageUrl) {
|
||||
saveMediaToGallery(imageUrl);
|
||||
saveMediaToGallery(imageUrl, t);
|
||||
}
|
||||
},
|
||||
textStyle: { color: '#4C320C' }
|
||||
|
||||
@ -81,7 +81,7 @@ const SelectModel = ({ modalDetailsVisible, setModalDetailsVisible, insets, setS
|
||||
onPress: () => {
|
||||
const imageUrl = item?.file_info?.url || item.video?.file_info?.url;
|
||||
if (imageUrl) {
|
||||
saveMediaToGallery(imageUrl);
|
||||
saveMediaToGallery(imageUrl, t);
|
||||
}
|
||||
},
|
||||
textStyle: { color: '#4C320C' }
|
||||
|
||||
@ -2,10 +2,9 @@ import { fetchApi } from "@/lib/server-api-util";
|
||||
import { Message } from "@/types/ask";
|
||||
import * as FileSystem from 'expo-file-system';
|
||||
import * as MediaLibrary from 'expo-media-library';
|
||||
import { TFunction } from "i18next";
|
||||
import { useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Alert } from 'react-native';
|
||||
const { t } = useTranslation()
|
||||
|
||||
// 实现一个函数,从两个数组中轮流插入新数组
|
||||
export const mergeArrays = (arr1: any[], arr2: any[]) => {
|
||||
@ -57,7 +56,7 @@ export const getConversation = async ({
|
||||
};
|
||||
|
||||
// 图片 视频 保存到本地
|
||||
export const saveMediaToGallery = async (mediaUrl: string) => {
|
||||
export const saveMediaToGallery = async (mediaUrl: string, t: TFunction) => {
|
||||
// 声明 fileUri 变量以便在 finally 块中使用
|
||||
let fileUri: string | null = null;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user