pull/196/head
Mikael Finstad 2020-02-12 00:40:10 +08:00
rodzic 9eb8f9e938
commit a4108210ee
1 zmienionych plików z 11 dodań i 5 usunięć

Wyświetl plik

@ -497,12 +497,18 @@ class App extends React.Component {
deleteSourceClick = async () => {
// eslint-disable-next-line no-alert
if (this.state.working || !window.confirm('Are you sure you want to move the source file to trash?')) return;
const { filePath, html5FriendlyPath } = this.state;
this.setState({ working: true });
await trash(filePath);
if (html5FriendlyPath) await trash(html5FriendlyPath);
this.resetState();
try {
this.setState({ working: true });
const { filePath, html5FriendlyPath } = this.state;
await trash(filePath);
if (html5FriendlyPath) await trash(html5FriendlyPath);
} catch (err) {
toast.fire({ type: 'error', title: `Failed to trash source file: ${err.message}` });
} finally {
this.resetState();
}
}
cutClick = async () => {