This differential implements draft reducer and uses it in master reducer
Details
Make sure eslint and flow do not point errors.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
lib/types/store-ops-types.js | ||
---|---|---|
1 ↗ | (On Diff #18471) | Add newline |
Can you explain why draftStoreOperations is empty for the setDraftStoreDrafts action?
I may be missing something... but at least based on my understand of the way messageStoreOperations and threadStoreOperations work this seems like it might be wrong?
lib/reducers/draft-reducer.js | ||
---|---|---|
20–21 ↗ | (On Diff #18529) | Whatever you prefer here, but can make a little more concise |
23–28 ↗ | (On Diff #18529) | Whatever you prefer here, but can make a little more concise |
50 ↗ | (On Diff #18529) | This is pretty smooth, took me a second lol |
67 ↗ | (On Diff #18529) | Wait are you sure draftStoreOperations should be empty in this case? I'd assume we'd want an update op for each entry in drafts to populate the SQLite drafts table? Probably a remove_all sort of op followed by a list of update ops? |
Wait no completely disregard what I said, setDraftStoreDrafts is equivalent to SET_MESSAGE_STORE_MESSAGES or SET_THREAD_STORE so shouldn't have any draftStoreOperations... we're just populating the Redux store here... sorry about that confusion.
lib/reducers/draft-reducer.js | ||
---|---|---|
19 ↗ | (On Diff #18557) | Please refer to the old draft reducer I linked to you previously |
lib/reducers/draft-reducer.js | ||
---|---|---|
30 | You aren't doing anything to clear out the drafts from SQLite when the user logs out. I know the database will be deleted, but we probably want to do the same thing we do for threads and messages... when the user logs out, have a operation that clears out the contents |