kopia lustrzana https://github.com/mifi/lossless-cut
improve trash #228
rodzic
9eb8f9e938
commit
a4108210ee
|
@ -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 () => {
|
||||
|
|
Ładowanie…
Reference in New Issue