fix(mobile): clear shared link description

This commit is contained in:
timonrieger
2026-06-03 23:04:11 +02:00
parent 4ac4781bfb
commit 0388c534ed
2 changed files with 8 additions and 6 deletions
@@ -366,8 +366,8 @@ class SharedLinkEditPage extends HookConsumerWidget {
bool? download;
bool? upload;
bool? meta;
String? desc;
var password = const Optional<String?>.absent();
var description = const Optional<String?>.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(),
+2 -2
View File
@@ -89,8 +89,8 @@ class SharedLinkService {
required bool? allowDownload,
required bool? allowUpload,
bool? changeExpiry = false,
String? description,
Optional<String?> password = const Optional.absent(),
Optional<String?> 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),
),