mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-17 10:21:33 +03:00
fixed logic picking wrong draft version
This commit is contained in:
parent
4a741801ba
commit
a73cbc9612
@ -207,7 +207,9 @@ class EditorContainer extends Component<any, any> {
|
||||
//if _draft is returned and param draft is available, compare timestamp, use latest
|
||||
//if no draft, use result anayways
|
||||
|
||||
if (_localDraft && (!paramDraft || paramDraft.timestamp < _localDraft.updated)) {
|
||||
const _remoteDraftModifiedAt = paramDraft ? new Date(paramDraft.modified).getTime() : 0;
|
||||
const _useLocalDraft = _localDraft && _remoteDraftModifiedAt < _localDraft.updated;
|
||||
if (_useLocalDraft) {
|
||||
this.setState({
|
||||
draftPost: {
|
||||
body: get(_localDraft, 'body', ''),
|
||||
|
Loading…
Reference in New Issue
Block a user