improved delete event by adding delay to process incoming

This commit is contained in:
Vishal 2022-10-11 01:55:54 +05:30
parent c2ea44e201
commit 77fd4d62e7
2 changed files with 4 additions and 2 deletions

View File

@ -170,7 +170,7 @@ bool sendDeleteEvent(Store node, String eventIdToDelete) {
String toSendMessage = '["EVENT",{"id":"$id","pubkey":"$userPublicKey","created_at":$createdAt,"kind":$replyKind,"tags":[$strTags],"content":"$content","sig":"$sig"}]';
sendRequest( gListRelayUrls1, toSendMessage);
print("sent event delete request with id = $id");
print(toSendMessage);
//print(toSendMessage);
} else {
print("${gWarningColor}The given id was not found and/or is not a valid id, or is not your event. Not deleted.$gColorEndMarker");
}
@ -467,6 +467,7 @@ Future<void> otherMenuUi(Store node) async {
String toDeleteId = eventIdToDelete.first;
print("Going to send a delete event for the following event with id ${toDeleteId}");
sendDeleteEvent(node, eventIdToDelete.first);
await processAnyIncomingEvents(node, false); // get latest event, this takes 300 ms
} else {
print("Invalid Event Id(s) entered = {$eventIdToDelete}");
}

View File

@ -3,7 +3,8 @@ description: A multi-platform nostr client built for terminal/console.
version: 0.0.8-beta
homepage: https://github.com/vishalxl/nostr_console
# Release 0.0.8-beta channel creation, and improved processing of incoming, with fix for this; fixed translation crash
# Release 0.0.8a-beta channel creation, and improved processing of incoming, with fix for this; fixed translation crash
# delete post improvement
environment:
sdk: '>=2.17.3 <3.0.0'