зеркало из https://github.com/mozilla/notes.git
Totally fix 'syncing...' message again, bring back synced translation in the drawer (#1277)
Fixes #1272 Fixes #1116
This commit is contained in:
Родитель
30fbd141ed
Коммит
dd5aac458d
|
@ -151,7 +151,7 @@ class DrawerItems extends React.Component {
|
|||
statusLabel = browser.i18n.getMessage('statusLabelSyncingDrawer');
|
||||
} else {
|
||||
let time = moment(this.props.state.sync.lastSynced).format('LT');
|
||||
statusLabel = browser.i18n.getMessage('editorLabelSynced') + ' ' + time;
|
||||
statusLabel = browser.i18n.getMessage('statusLabelTimeDrawer', time);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -147,7 +147,9 @@ function sync(sync = {}, action) {
|
|||
});
|
||||
case CREATE_NOTE:
|
||||
return Object.assign({}, sync, {
|
||||
isSyncing: false
|
||||
isSyncing: false,
|
||||
isSyncingFrom: null,
|
||||
lastSynced: new Date()
|
||||
});
|
||||
case ERROR:
|
||||
return Object.assign({}, sync, {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
kintoLoad
|
||||
kintoLoad,
|
||||
textSynced
|
||||
} from '../actions';
|
||||
import { store } from '../store';
|
||||
import browser from '../browser';
|
||||
|
@ -200,7 +201,6 @@ class BrowserStorageCredentials extends Credentials { // eslint-disable-line no-
|
|||
let lastSyncTimestamp = null;
|
||||
|
||||
function syncKinto(client, loginDetails) {
|
||||
|
||||
// If device is offline, we skip syncing.
|
||||
if (store.getState().sync.isConnected === false) return Promise.resolve();
|
||||
|
||||
|
@ -246,6 +246,8 @@ function syncKinto(client, loginDetails) {
|
|||
});
|
||||
})
|
||||
.then(syncResult => {
|
||||
store.dispatch(textSynced());
|
||||
|
||||
lastSyncTimestamp = new Date().getTime(); // eslint-disable-line no-undef
|
||||
|
||||
// FIXME: Do we need to do anything with errors, published,
|
||||
|
|
Загрузка…
Ссылка в новой задаче