1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-12 23:23:54 +00:00

feat: error rename alert message (#7394)

This commit is contained in:
Rukario 2025-03-04 17:29:52 -08:00 committed by GitHub
parent 491cdc1560
commit 9ea7153ee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@
or any future license endorsed by Mnemosyne LLC.
License text can be found in the licenses/ folder. */
import { AlertDialog } from './alert-dialog.js';
import { createDialogContainer } from './utils.js';
export class RenameDialog extends EventTarget {
@ -39,7 +40,6 @@ export class RenameDialog extends EventTarget {
this.dispatchEvent(new Event('close'));
delete this.controller;
delete this.remote;
delete this.elements;
delete this.torrents;
@ -56,7 +56,15 @@ export class RenameDialog extends EventTarget {
this.remote.renameTorrent([tor.getId()], old_name, new_name, (response) => {
if (response.result === 'success') {
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();