mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: export
This commit is contained in:
12
src/view/download/index.tsx
vendored
12
src/view/download/index.tsx
vendored
@@ -18,7 +18,7 @@ function renderFile(buff: Uint8Array, type: string) {
|
||||
return URL.createObjectURL(new Blob([buff], { type: renderType }));
|
||||
}
|
||||
|
||||
export default function SyncPrompts() {
|
||||
export default function Download() {
|
||||
const [downloadPath, setDownloadPath] = useState('');
|
||||
const [source, setSource] = useState('');
|
||||
const [isVisible, setVisible] = useState(false);
|
||||
@@ -51,9 +51,6 @@ export default function SyncPrompts() {
|
||||
setVisible(true);
|
||||
return;
|
||||
}
|
||||
if (opInfo.opType === 'file') {
|
||||
await shell.open(file);
|
||||
}
|
||||
if (opInfo.opType === 'delete') {
|
||||
await fs.removeFile(file);
|
||||
await handleRefresh();
|
||||
@@ -90,8 +87,9 @@ export default function SyncPrompts() {
|
||||
};
|
||||
|
||||
const handleRefresh = async () => {
|
||||
await invoke('download_list', { pathname: CHAT_DOWNLOAD_JSON });
|
||||
refreshJson();
|
||||
await invoke('download_list', { pathname: CHAT_DOWNLOAD_JSON, dir: 'download' });
|
||||
const data = await refreshJson();
|
||||
opInit(data);
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
@@ -107,7 +105,7 @@ export default function SyncPrompts() {
|
||||
<>
|
||||
<Popconfirm
|
||||
overlayStyle={{ width: 250 }}
|
||||
title="Sync will overwrite the previous data, confirm to sync?"
|
||||
title="Files cannot be recovered after deletion, are you sure you want to delete them?"
|
||||
placement="topLeft"
|
||||
onConfirm={handleDelete}
|
||||
okText="Yes"
|
||||
|
||||
Reference in New Issue
Block a user