зеркало из https://github.com/mozilla/notes.git
Merge pull request #506 from mozilla/502-re-enabling-sync-should-retrieve-remote-content
Re enabling sync with the same server should retrieve remote content.
This commit is contained in:
Коммит
3248f44552
|
@ -11,24 +11,25 @@ extends:
|
|||
|
||||
globals:
|
||||
BrowserStorageCredentials: false
|
||||
fxaCryptoRelier: false
|
||||
fxaFetchProfile: false
|
||||
formatFooterTime: false
|
||||
ClassicEditor: false
|
||||
Jose: false
|
||||
JoseJWE: false
|
||||
Kinto: false
|
||||
KintoClient: false
|
||||
loadFromKinto: false
|
||||
retrieveNote: false
|
||||
Quill: false
|
||||
saveToKinto: false
|
||||
TestPilotGA: false
|
||||
ClassicEditor: false
|
||||
migrationCheck: false
|
||||
fxaRenewCredential: false
|
||||
customizeEditor: false
|
||||
disconnectFromKinto: false
|
||||
formatFooterTime: false
|
||||
fxaCryptoRelier: false
|
||||
fxaFetchProfile: false
|
||||
fxaRenewCredential: false
|
||||
getPadStats: false
|
||||
loadFromKinto: false
|
||||
localizeEditorButtons: false
|
||||
migrationCheck: false
|
||||
retrieveNote: false
|
||||
saveToKinto: false
|
||||
setAnimation: false
|
||||
|
||||
root: true
|
||||
|
|
|
@ -106,8 +106,10 @@ browser.runtime.onMessage.addListener(function(eventData) {
|
|||
});
|
||||
break;
|
||||
case 'disconnected':
|
||||
sendMetrics('webext-button-disconnect', eventData.context);
|
||||
credentials.clear();
|
||||
disconnectFromKinto(client).then(() => {
|
||||
sendMetrics('webext-button-disconnect', eventData.context);
|
||||
credentials.clear();
|
||||
});
|
||||
break;
|
||||
case 'kinto-load':
|
||||
retrieveNote(client).then((result) => {
|
||||
|
|
10
src/sync.js
10
src/sync.js
|
@ -1,6 +1,7 @@
|
|||
/* exported BrowserStorageCredentials */
|
||||
/* exported disconnectFromKinto */
|
||||
/* exported loadFromKinto */
|
||||
/* exported saveToKinto */
|
||||
/* exported BrowserStorageCredentials */
|
||||
|
||||
let syncDebounce = null;
|
||||
|
||||
|
@ -346,3 +347,10 @@ function saveToKinto(client, credentials, content) {
|
|||
syncDebounce = setTimeout(later, 1000);
|
||||
return promise;
|
||||
}
|
||||
|
||||
function disconnectFromKinto(client) {
|
||||
const notes = client.collection('notes', {
|
||||
idSchema: notesIdSchema,
|
||||
});
|
||||
return notes.resetSyncStatus();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче