Page MenuHomePhabricator

D12264.id40821.diff
No OneTemporary

D12264.id40821.diff

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
@@ -223,7 +223,7 @@
textInput: ?React.ElementRef<typeof BaseTextInput>;
creating: boolean = false;
needsUpdateAfterCreation: boolean = false;
- needsDeleteAfterCreation: boolean = false;
+ needsDeleteAfterSave: boolean = false;
nextSaveAttemptIndex: number = 0;
mounted: boolean = false;
deleted: boolean = false;
@@ -653,12 +653,13 @@
this.guardedSetState({ loadingStatus: 'inactive' });
}
this.creating = false;
+ this.currentlySaving = null;
if (this.needsUpdateAfterCreation) {
this.needsUpdateAfterCreation = false;
this.dispatchSave(response.entryID, this.state.text);
}
- if (this.needsDeleteAfterCreation) {
- this.needsDeleteAfterCreation = false;
+ if (this.needsDeleteAfterSave) {
+ this.needsDeleteAfterSave = false;
this.dispatchDelete(response.entryID, this.state.text);
response = {
...response,
@@ -694,7 +695,10 @@
if (curSaveAttempt + 1 === this.nextSaveAttemptIndex) {
this.guardedSetState({ loadingStatus: 'inactive' });
}
- if (this.deleted) {
+ this.currentlySaving = null;
+ if (this.needsDeleteAfterSave) {
+ this.needsDeleteAfterSave = false;
+ this.dispatchDelete(response.entryID, this.state.text);
response = {
...response,
updatesResult: this.patchUpdateInfosForDeletion(
@@ -766,8 +770,8 @@
dispatchDelete(serverID: ?string, prevText: string) {
if (this.deleted) {
return;
- } else if (this.creating) {
- this.needsDeleteAfterCreation = true;
+ } else if (this.creating || this.currentlySaving) {
+ this.needsDeleteAfterSave = true;
return;
}
this.deleted = true;

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 6, 8:47 PM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2432205
Default Alt Text
D12264.id40821.diff (1 KB)

Event Timeline