MOBILE-1973 sync: Do not sync logged out sites
parent
c048c6f9bf
commit
04bc8fd81b
|
@ -243,7 +243,7 @@ export class CoreSyncBaseProvider {
|
||||||
if (!siteId) {
|
if (!siteId) {
|
||||||
// No site ID defined, sync all sites.
|
// No site ID defined, sync all sites.
|
||||||
this.logger.debug(`Try to sync '${syncFunctionLog}' in all sites.`);
|
this.logger.debug(`Try to sync '${syncFunctionLog}' in all sites.`);
|
||||||
promise = this.sitesProvider.getSitesIds();
|
promise = this.sitesProvider.getLoggedInSitesIds();
|
||||||
} else {
|
} else {
|
||||||
this.logger.debug(`Try to sync '${syncFunctionLog}' in site '${siteId}'.`);
|
this.logger.debug(`Try to sync '${syncFunctionLog}' in site '${siteId}'.`);
|
||||||
promise = Promise.resolve([siteId]);
|
promise = Promise.resolve([siteId]);
|
||||||
|
|
|
@ -1050,6 +1050,19 @@ export class CoreSitesProvider {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the list of IDs of sites stored and not logged out.
|
||||||
|
*
|
||||||
|
* @return {Promise<string[]>} Promise resolved when the sites IDs are retrieved.
|
||||||
|
*/
|
||||||
|
getLoggedInSitesIds(): Promise<string[]> {
|
||||||
|
return this.appDB.getRecords(this.SITES_TABLE, {loggedOut : 0}).then((sites) => {
|
||||||
|
return sites.map((site) => {
|
||||||
|
return site.id;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of IDs of sites stored.
|
* Get the list of IDs of sites stored.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue