diff --git a/native/calendar/entry.react.js b/native/calendar/entry.react.js --- a/native/calendar/entry.react.js +++ b/native/calendar/entry.react.js @@ -731,29 +731,25 @@ dispatchDelete(serverID: ?string) { if (this.deleted) { return; + } else if (this.creating) { + this.needsDeleteAfterCreation = true; + return; } this.deleted = true; LayoutAnimation.easeInEaseOut(); const { localID } = this.props.entryInfo; - void this.props.dispatchActionPromise( - deleteEntryActionTypes, - this.deleteAction(serverID), - undefined, - { localID, serverID }, - ); - } - - async deleteAction(serverID: ?string): Promise { if (serverID) { - return await this.props.deleteEntry({ - entryID: serverID, - prevText: this.props.entryInfo.text, - calendarQuery: this.props.calendarQuery(), - }); - } else if (this.creating) { - this.needsDeleteAfterCreation = true; + void this.props.dispatchActionPromise( + deleteEntryActionTypes, + this.props.deleteEntry({ + entryID: serverID, + prevText: this.props.entryInfo.text, + calendarQuery: this.props.calendarQuery(), + }), + undefined, + { localID, serverID }, + ); } - return null; } onPressThreadName: () => void = () => {