Skip to content

Commit

Permalink
Show toast on error adding note to self.
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Sein <[email protected]>
  • Loading branch information
Ivansss committed Oct 2, 2023
1 parent be1c6d7 commit c4d46b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions NextcloudTalk/NCChatViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1666,16 +1666,24 @@ - (void)didPressNoteToSelf:(NCChatMessage *)message {
[[NCAPIController sharedInstance] shareRichObject:message.richObjectFromObjectShare inRoom:room.token forAccount:activeAccount withCompletionBlock:^(NSError *error) {
if (!error) {
[self.view makeToast:NSLocalizedString(@"Added note to self", nil) duration:1.5 position:CSToastPositionCenter];
} else {
[self.view makeToast:NSLocalizedString(@"An error occurred while adding note", nil) duration:1.5 position:CSToastPositionCenter];
}
}];
} else {
[[NCAPIController sharedInstance] sendChatMessage:message.parsedMessage.string toRoom:room.token displayName:nil replyTo:-1 referenceId:nil silently:NO forAccount:activeAccount withCompletionBlock:^(NSError *error) {
if (!error) {
[self.view makeToast:NSLocalizedString(@"Added note to self", nil) duration:1.5 position:CSToastPositionCenter];
} else {
[self.view makeToast:NSLocalizedString(@"An error occurred while adding note", nil) duration:1.5 position:CSToastPositionCenter];
}
}];
}
} else {
[self.view makeToast:NSLocalizedString(@"An error occurred while adding note", nil) duration:1.5 position:CSToastPositionCenter];
}
} else {
[self.view makeToast:NSLocalizedString(@"An error occurred while adding note", nil) duration:1.5 position:CSToastPositionCenter];
}
}];
}
Expand Down

0 comments on commit c4d46b2

Please sign in to comment.