HomePhabricator
Diffusion Comm 798d69edb25f

[native] Avoid flicker when deleting during save/creation

Description

[native] Avoid flicker when deleting during save/creation

Summary:
Because the DELETE_ENTRY_STARTED action gets dispatched inside the promises passed to dispatchActionPromise, it gets dispatched before the SAVE_ENTRY_SUCCESS / CREATE_ENTRY_SUCCESS.

This causes a flicker where the Entry "comes back from the dead". The issue is that DELETE_ENTRY_STARTED clears it initially (see entry-reducer.js), but then SAVE_ENTRY_SUCCESS / CREATE_ENTRY_SUCCESS unclear it, before DELETE_ENTRY_SUCCESS finally clears it (again).

This diff avoids the issue by making sure we dispatch SAVE_ENTRY_SUCCESS / CREATE_ENTRY_SUCCESS before DELETE_ENTRY_STARTED.

Depends on D12264

Test Plan: Test both deletion-during-creation and deletion-during-save and confirm that neither has a flicker anymore

Reviewers: tomek

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D12278

Details

Provenance
ashoatAuthored on Jun 3 2024, 5:24 AM
Reviewer
tomek
Differential Revision
D12278: [native] Avoid flicker when deleting during save/creation
Parents
rCOMM8ef214ac1d76: [native] Make sure we finish saving Entry before deleting
Branches
Unknown
Tags
Unknown