diff --git a/mobile/lib/pages/library/shared_link/shared_link_edit.page.dart b/mobile/lib/pages/library/shared_link/shared_link_edit.page.dart index 94f83aecb9..975030256f 100644 --- a/mobile/lib/pages/library/shared_link/shared_link_edit.page.dart +++ b/mobile/lib/pages/library/shared_link/shared_link_edit.page.dart @@ -366,8 +366,8 @@ class SharedLinkEditPage extends HookConsumerWidget { bool? download; bool? upload; bool? meta; - String? desc; var password = const Optional.absent(); + var description = const Optional.absent(); String? slug; DateTime? expiry; bool? changeExpiry; @@ -384,8 +384,10 @@ class SharedLinkEditPage extends HookConsumerWidget { meta = showMetadata.value; } - if (descriptionController.text != existingLink!.description) { - desc = descriptionController.text; + if (descriptionController.text != (existingLink!.description ?? '')) { + description = descriptionController.text.isEmpty + ? const Optional.present(null) + : Optional.present(descriptionController.text); } if (passwordController.text != (existingLink!.password ?? '')) { @@ -413,7 +415,7 @@ class SharedLinkEditPage extends HookConsumerWidget { showMeta: meta, allowDownload: download, allowUpload: upload, - description: desc, + description: description, password: password, slug: slug, expiresAt: expiry?.toUtc(), diff --git a/mobile/lib/services/shared_link.service.dart b/mobile/lib/services/shared_link.service.dart index 84a4d79bd5..1d511b3120 100644 --- a/mobile/lib/services/shared_link.service.dart +++ b/mobile/lib/services/shared_link.service.dart @@ -89,8 +89,8 @@ class SharedLinkService { required bool? allowDownload, required bool? allowUpload, bool? changeExpiry = false, - String? description, Optional password = const Optional.absent(), + Optional description = const Optional.absent(), String? slug, DateTime? expiresAt, }) async { @@ -102,8 +102,8 @@ class SharedLinkService { allowDownload: allowDownload == null ? const Optional.absent() : Optional.present(allowDownload), allowUpload: allowUpload == null ? const Optional.absent() : Optional.present(allowUpload), expiresAt: expiresAt == null ? const Optional.absent() : Optional.present(expiresAt), - description: description == null ? const Optional.absent() : Optional.present(description), password: password, + description: description, slug: slug == null ? const Optional.absent() : Optional.present(slug), changeExpiryTime: changeExpiry == null ? const Optional.absent() : Optional.present(changeExpiry), ),