Skip to content

Commit

Permalink
Fix disabled add button when opening a magnet link
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Ray committed Dec 14, 2024
1 parent adc9b79 commit 398f4ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/lib/dialogs/add_torrent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,24 @@ class _AddTorrentDialogState extends State<AddTorrentDialog> {
late TextEditingController _torrentLinkController;
String? _filename;
String? pickedDownloadDir;
String _torrentLink = '';
String _torrentLink = ''; // Track a state to trigger updates

@override
void initState() {
super.initState();
_torrentLinkController =
TextEditingController(text: widget.initialMagnetLink);
TextEditingController();

_torrentLinkController.addListener(() {
setState(() {
_torrentLink = _torrentLinkController.text;
});
});

if(widget.initialMagnetLink != null) {
_torrentLinkController.text = widget.initialMagnetLink!;
}

setState(() {
_filename = widget.initialContentPath;
});
Expand Down

0 comments on commit 398f4ea

Please sign in to comment.