mirror of
https://github.com/transmission/transmission
synced 2025-03-13 23:48:49 +00:00
feat: error rename alert message (#7394)
This commit is contained in:
parent
491cdc1560
commit
9ea7153ee4
1 changed files with 9 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
or any future license endorsed by Mnemosyne LLC.
|
or any future license endorsed by Mnemosyne LLC.
|
||||||
License text can be found in the licenses/ folder. */
|
License text can be found in the licenses/ folder. */
|
||||||
|
|
||||||
|
import { AlertDialog } from './alert-dialog.js';
|
||||||
import { createDialogContainer } from './utils.js';
|
import { createDialogContainer } from './utils.js';
|
||||||
|
|
||||||
export class RenameDialog extends EventTarget {
|
export class RenameDialog extends EventTarget {
|
||||||
|
@ -39,7 +40,6 @@ export class RenameDialog extends EventTarget {
|
||||||
|
|
||||||
this.dispatchEvent(new Event('close'));
|
this.dispatchEvent(new Event('close'));
|
||||||
|
|
||||||
delete this.controller;
|
|
||||||
delete this.remote;
|
delete this.remote;
|
||||||
delete this.elements;
|
delete this.elements;
|
||||||
delete this.torrents;
|
delete this.torrents;
|
||||||
|
@ -56,7 +56,15 @@ export class RenameDialog extends EventTarget {
|
||||||
this.remote.renameTorrent([tor.getId()], old_name, new_name, (response) => {
|
this.remote.renameTorrent([tor.getId()], old_name, new_name, (response) => {
|
||||||
if (response.result === 'success') {
|
if (response.result === 'success') {
|
||||||
tor.refresh(response.arguments);
|
tor.refresh(response.arguments);
|
||||||
|
} else if (response.result === 'Invalid argument') {
|
||||||
|
const connection_alert = new AlertDialog({
|
||||||
|
heading: `Error renaming "${old_name}"`,
|
||||||
|
message:
|
||||||
|
'Could not rename a torrent or file name. The path to file may have changed/not reflected correctly or the argument is invalid.',
|
||||||
|
});
|
||||||
|
this.controller.setCurrentPopup(connection_alert);
|
||||||
}
|
}
|
||||||
|
delete this.controller;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.close();
|
this.close();
|
||||||
|
|
Loading…
Add table
Reference in a new issue