fix(mobile): clear shared link expiry
parent
0388c534ed
commit
47bf83813d
|
|
@ -369,8 +369,7 @@ class SharedLinkEditPage extends HookConsumerWidget {
|
|||
var password = const Optional<String?>.absent();
|
||||
var description = const Optional<String?>.absent();
|
||||
String? slug;
|
||||
DateTime? expiry;
|
||||
bool? changeExpiry;
|
||||
var expiry = const Optional<DateTime?>.absent();
|
||||
|
||||
if (allowDownload.value != existingLink!.allowDownload) {
|
||||
download = allowDownload.value;
|
||||
|
|
@ -404,8 +403,7 @@ class SharedLinkEditPage extends HookConsumerWidget {
|
|||
|
||||
final newExpiry = expiryAfter.value;
|
||||
if (newExpiry?.toUtc() != existingLink!.expiresAt?.toUtc()) {
|
||||
expiry = newExpiry;
|
||||
changeExpiry = true;
|
||||
expiry = newExpiry == null ? const Optional.present(null) : Optional.present(newExpiry.toUtc());
|
||||
}
|
||||
|
||||
await ref
|
||||
|
|
@ -418,8 +416,7 @@ class SharedLinkEditPage extends HookConsumerWidget {
|
|||
description: description,
|
||||
password: password,
|
||||
slug: slug,
|
||||
expiresAt: expiry?.toUtc(),
|
||||
changeExpiry: changeExpiry,
|
||||
expiresAt: expiry,
|
||||
);
|
||||
if (!context.mounted) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -88,11 +88,10 @@ class SharedLinkService {
|
|||
required bool? showMeta,
|
||||
required bool? allowDownload,
|
||||
required bool? allowUpload,
|
||||
bool? changeExpiry = false,
|
||||
Optional<String?> password = const Optional.absent(),
|
||||
Optional<String?> description = const Optional.absent(),
|
||||
String? slug,
|
||||
DateTime? expiresAt,
|
||||
Optional<DateTime?> expiresAt = const Optional.absent(),
|
||||
}) async {
|
||||
try {
|
||||
final responseDto = await _apiService.sharedLinksApi.updateSharedLink(
|
||||
|
|
@ -101,11 +100,10 @@ class SharedLinkService {
|
|||
showMetadata: showMeta == null ? const Optional.absent() : Optional.present(showMeta),
|
||||
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),
|
||||
password: password,
|
||||
description: description,
|
||||
expiresAt: expiresAt,
|
||||
slug: slug == null ? const Optional.absent() : Optional.present(slug),
|
||||
changeExpiryTime: changeExpiry == null ? const Optional.absent() : Optional.present(changeExpiry),
|
||||
),
|
||||
);
|
||||
if (responseDto != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue