Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3157648
D12264.id40821.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12264.id40821.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12264: [native] Make sure we finish saving Entry before deleting
Attached
Detach File
Event Timeline
Log In to Comment