mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2024-10-01 06:55:46 -04:00
watchvalue fixes
This commit is contained in:
parent
37b1717a71
commit
64d0019e6e
@ -96,6 +96,7 @@
|
||||
"failed_to_accept": "Failed to accept contact invitation",
|
||||
"failed_to_reject": "Failed to reject contact invitation",
|
||||
"invalid_invitation": "Invalid invitation",
|
||||
"try_again_online": "Invitation could not be reached, try again when online",
|
||||
"protected_with_pin": "Contact invitation is protected with a PIN",
|
||||
"protected_with_password": "Contact invitation is protected with a password",
|
||||
"invalid_pin": "Invalid PIN",
|
||||
|
@ -23,13 +23,11 @@ class RenderStateElement {
|
||||
if (!isLocal) {
|
||||
return null;
|
||||
}
|
||||
if (reconciled && sent) {
|
||||
if (!reconciledOffline && !sentOffline) {
|
||||
return MessageSendState.delivered;
|
||||
}
|
||||
return MessageSendState.sent;
|
||||
}
|
||||
|
||||
if (sent && !sentOffline) {
|
||||
return MessageSendState.delivered;
|
||||
}
|
||||
if (reconciled && !reconciledOffline) {
|
||||
return MessageSendState.sent;
|
||||
}
|
||||
return MessageSendState.sending;
|
||||
|
@ -224,8 +224,13 @@ class InvitationDialogState extends State<InvitationDialog> {
|
||||
_validInvitation = null;
|
||||
widget.onValidationFailed();
|
||||
});
|
||||
} on VeilidAPIException {
|
||||
final errorText = translate('invitation_dialog.invalid_invitation');
|
||||
} on VeilidAPIException catch (e) {
|
||||
late final String errorText;
|
||||
if (e is VeilidAPIExceptionTryAgain) {
|
||||
errorText = translate('invitation_dialog.try_again_online');
|
||||
} else {
|
||||
errorText = translate('invitation_dialog.invalid_invitation');
|
||||
}
|
||||
if (mounted) {
|
||||
showErrorToast(context, errorText);
|
||||
}
|
||||
|
@ -390,14 +390,14 @@ class DHTRecord {
|
||||
// range we care about, don't pass it through
|
||||
final overlappedFirstSubkey = overlappedSubkeys.firstSubkey;
|
||||
final updateFirstSubkey = subkeys.firstSubkey;
|
||||
final updatedData = (overlappedFirstSubkey != null &&
|
||||
updateFirstSubkey != null &&
|
||||
overlappedFirstSubkey == updateFirstSubkey)
|
||||
? data
|
||||
: null;
|
||||
// Report only watched subkeys
|
||||
watchController?.add(DHTRecordWatchChange(
|
||||
local: local, data: updatedData, subkeys: overlappedSubkeys));
|
||||
if (overlappedFirstSubkey != null && updateFirstSubkey != null) {
|
||||
final updatedData =
|
||||
overlappedFirstSubkey == updateFirstSubkey ? data : null;
|
||||
|
||||
// Report only watched subkeys
|
||||
watchController?.add(DHTRecordWatchChange(
|
||||
local: local, data: updatedData, subkeys: overlappedSubkeys));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user