fix(mobile): clear shared link description
parent
9d4a6614b1
commit
000c39ad21
|
|
@ -11,6 +11,7 @@ import 'package:immich_mobile/models/shared_link/shared_link.model.dart';
|
|||
import 'package:immich_mobile/providers/server_info.provider.dart';
|
||||
import 'package:immich_mobile/providers/shared_link.provider.dart';
|
||||
import 'package:immich_mobile/services/shared_link.service.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:immich_mobile/utils/url_helper.dart';
|
||||
import 'package:immich_mobile/widgets/common/confirm_dialog.dart';
|
||||
import 'package:immich_mobile/widgets/common/immich_toast.dart';
|
||||
|
|
@ -365,7 +366,7 @@ class SharedLinkEditPage extends HookConsumerWidget {
|
|||
bool? download;
|
||||
bool? upload;
|
||||
bool? meta;
|
||||
String? desc;
|
||||
var description = const Optional<String?>.absent();
|
||||
String? password;
|
||||
String? slug;
|
||||
DateTime? expiry;
|
||||
|
|
@ -383,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) {
|
||||
|
|
@ -410,7 +413,7 @@ class SharedLinkEditPage extends HookConsumerWidget {
|
|||
showMeta: meta,
|
||||
allowDownload: download,
|
||||
allowUpload: upload,
|
||||
description: desc,
|
||||
description: description,
|
||||
password: password,
|
||||
slug: slug,
|
||||
expiresAt: expiry?.toUtc(),
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class SharedLinkService {
|
|||
required bool? allowDownload,
|
||||
required bool? allowUpload,
|
||||
bool? changeExpiry = false,
|
||||
String? description,
|
||||
Optional<String?> description = const Optional.absent(),
|
||||
String? password,
|
||||
String? slug,
|
||||
DateTime? expiresAt,
|
||||
|
|
@ -102,7 +102,7 @@ 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),
|
||||
description: description,
|
||||
password: password == null ? const Optional.absent() : Optional.present(password),
|
||||
slug: slug == null ? const Optional.absent() : Optional.present(slug),
|
||||
changeExpiryTime: changeExpiry == null ? const Optional.absent() : Optional.present(changeExpiry),
|
||||
|
|
|
|||
Loading…
Reference in New Issue