mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-12 11:24:08 +00:00
feat: enhance deep link handling for install extensions (#1249)
This commit is contained in:
7 files changed
+77
-51
No files matched your search
@@ -20,6 +20,9 @@ class CreateController extends GetxController
|
||||
final oldUrl = "".obs;
|
||||
final fileDataUri = "".obs;
|
||||
|
||||
/// Flag to prevent handling pending create task from deep link multiple times
|
||||
bool pendingCreateHandled = false;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
@@ -82,17 +82,16 @@ class CreateView extends GetView<CreateController> {
|
||||
_pathController.text = renderPathPlaceholders(downloadDir);
|
||||
}
|
||||
// Initialize archive settings from global config if not already set
|
||||
if (_autoExtractController.value == null) {
|
||||
_autoExtractController.value =
|
||||
appController.downloaderConfig.value.archive.autoExtract;
|
||||
}
|
||||
if (_deleteAfterExtractController.value == null) {
|
||||
_deleteAfterExtractController.value =
|
||||
appController.downloaderConfig.value.archive.deleteAfterExtract;
|
||||
}
|
||||
_autoExtractController.value ??=
|
||||
appController.downloaderConfig.value.archive.autoExtract;
|
||||
_deleteAfterExtractController.value ??=
|
||||
appController.downloaderConfig.value.archive.deleteAfterExtract;
|
||||
|
||||
// Handle pending create task from deep link
|
||||
final CreateTask? routerParams = Get.rootDelegate.arguments();
|
||||
if (routerParams?.req?.url.isNotEmpty ?? false) {
|
||||
if ((routerParams?.req?.url.isNotEmpty ?? false) &&
|
||||
!controller.pendingCreateHandled) {
|
||||
controller.pendingCreateHandled = true;
|
||||
// get url from route arguments
|
||||
final url = routerParams!.req!.url;
|
||||
_urlController.text = url;
|
||||
|
||||
Reference in new issue
Block a user