208
209
if (remoteChange !== Change.None) {
211
>
const addedCollections: string[] = [];
212
>
const canAddRemoteProfiles = remoteProfiles.length + (remote?.added.length ?? 0) <= 20;
213
>
if (canAddRemoteProfiles) {
214
>
for (const profile of remote?.added || []) {
215
>
const collection = await this.userDataSyncStoreService.createCollection(this.syncHeaders);
216
>
this.logService.trace(`${this.syncResourceLogLabel}: Created collection "${collection}" for "${profile.name}".`);
217
>
addedCollections.push(collection);
218
>
remoteProfiles.push({ id: profile.id, name: profile.name, collection, icon: profile.icon, useDefaultFlags: profile.useDefaultFlags });
219
>
}
220
>
} else {
221
this.logService.info(`${this.syncResourceLogLabel}: Could not create remote profiles as there are too many profiles.`);
222
}
224
remoteProfiles.splice(remoteProfiles.findIndex(({ id }) => profile.id === id), 1);
225
}
227
const profileToBeUpdated = remoteProfiles.find(({ id }) => profile.id === id);
228
if (profileToBeUpdated) {