mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-17 10:21:33 +03:00
saving local draft first when attempting to save draft to db
This commit is contained in:
parent
a73cbc9612
commit
bb9e6a1625
@ -44,6 +44,7 @@ import {
|
|||||||
updateDraftCache,
|
updateDraftCache,
|
||||||
} from '../../../redux/actions/cacheActions';
|
} from '../../../redux/actions/cacheActions';
|
||||||
import QUERIES from '../../../providers/queries/queryKeys';
|
import QUERIES from '../../../providers/queries/queryKeys';
|
||||||
|
import bugsnapInstance from '../../../config/bugsnag';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Props Name Description Value
|
* Props Name Description Value
|
||||||
@ -378,8 +379,15 @@ class EditorContainer extends Component<any, any> {
|
|||||||
const { isDraftSaved, draftId, thumbIndex, isReply, rewardType } = this.state;
|
const { isDraftSaved, draftId, thumbIndex, isReply, rewardType } = this.state;
|
||||||
const { currentAccount, dispatch, intl, queryClient } = this.props;
|
const { currentAccount, dispatch, intl, queryClient } = this.props;
|
||||||
|
|
||||||
if (isReply) {
|
try {
|
||||||
|
//saves draft locallly
|
||||||
this._saveCurrentDraft(this._updatedDraftFields);
|
this._saveCurrentDraft(this._updatedDraftFields);
|
||||||
|
} catch (err) {
|
||||||
|
console.warn('local draft safe failed, skipping for remote only', err);
|
||||||
|
bugsnapInstance.notify(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isReply) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,9 +477,6 @@ class EditorContainer extends Component<any, any> {
|
|||||||
isDraftSaving: false,
|
isDraftSaving: false,
|
||||||
isDraftSaved: false,
|
isDraftSaved: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
//saves draft locally if remote draft save fails
|
|
||||||
this._saveCurrentDraft(this._updatedDraftFields);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
|
Loading…
Reference in New Issue
Block a user