Improve archive error display
parent
dc2615e107
commit
64d313c858
|
@ -1135,7 +1135,11 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
|
|||
|
||||
try {
|
||||
this.loading++;
|
||||
for await (const delIds of dav.archiveFilesByIds(Array.from(this.selection.keys()), !this.routeIsArchive())) {
|
||||
for await (let delIds of dav.archiveFilesByIds(Array.from(this.selection.keys()), !this.routeIsArchive())) {
|
||||
delIds = delIds.filter(x => x);
|
||||
if (delIds.length === 0) {
|
||||
continue
|
||||
}
|
||||
const delPhotos = delIds.map(id => this.selection.get(id));
|
||||
await this.deleteFromViewWithAnimation(delPhotos);
|
||||
}
|
||||
|
|
|
@ -245,8 +245,9 @@ export async function archiveFile(fileid: number, archive: boolean) {
|
|||
await archiveFile(id, archive);
|
||||
return id as number;
|
||||
} catch (error) {
|
||||
console.error('Failed to archive', id, error);
|
||||
showError(t('memories', 'Failed to archive some files.'));
|
||||
console.error('Failed to (un)archive', id, error);
|
||||
const msg = error?.response?.data?.message || t('memories', 'General Failure');
|
||||
showError(t('memories', 'Error: {msg}', { msg }));
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue