Show some error in filemanager if pasting fails

This commit is contained in:
Johannes Zellner
2024-11-08 18:28:57 +01:00
parent fcccccaaae
commit a09202d1fa
2 changed files with 23 additions and 14 deletions

View File

@@ -1,6 +1,8 @@
<template>
<MainLayout>
<template #dialogs>
<Notification />
<Dialog ref="fatalErrorDialog" modal title="Error">
<p>{{ fatalError }}</p>
</Dialog>
@@ -97,7 +99,7 @@
import { marked } from 'marked';
import { fetcher, Dialog, DirectoryView, TopBar, Breadcrumb, BottomBar, Button, InputDialog, MainLayout, Menu, FileUploader, Spinner } from 'pankow';
import { fetcher, Dialog, DirectoryView, TopBar, Breadcrumb, BottomBar, Button, InputDialog, MainLayout, Menu, Notification, FileUploader, Spinner } from 'pankow';
import { sanitize, sleep } from 'pankow/utils';
import { ISTATES } from '../constants.js';
@@ -124,6 +126,7 @@ export default {
InputDialog,
MainLayout,
Menu,
Notification,
Breadcrumb,
PreviewPanel,
Spinner,
@@ -477,7 +480,12 @@ export default {
window.addEventListener('beforeunload', beforeUnloadListener, { capture: true });
this.$refs.pasteInProgressDialog.open();
await this.directoryModel.paste(targetPath, action, files);
try {
await this.directoryModel.paste(targetPath, action, files);
} catch (e) {
window.pankow.notify({ type: 'danger', text: e, persistent: true })
}
this.clipboard = {};
await this.loadCwd();