This commit is contained in:
Sandeep Somavarapu
2020-07-14 21:19:41 +02:00
parent cf0094f9eb
commit fd455c37d1
10 changed files with 115 additions and 37 deletions

View File

@@ -86,6 +86,10 @@ export class UserDataSyncService extends Disposable implements IUserDataSyncServ
return this.channel.call('reset');
}
resetRemote(): Promise<void> {
return this.channel.call('resetRemote');
}
resetLocal(): Promise<void> {
return this.channel.call('resetLocal');
}
@@ -165,7 +169,16 @@ class ManualSyncTask implements IManualSyncTask {
readonly manifest: IUserDataManifest | null,
sharedProcessService: ISharedProcessService,
) {
this.channel = sharedProcessService.getChannel(`manualSyncTask-${id}`);
const manualSyncTaskChannel = sharedProcessService.getChannel(`manualSyncTask-${id}`);
this.channel = {
call<T>(command: string, arg?: any, cancellationToken?: CancellationToken): Promise<T> {
return manualSyncTaskChannel.call(command, arg, cancellationToken)
.then(null, error => { throw UserDataSyncError.toUserDataSyncError(error); });
},
listen<T>(event: string, arg?: any): Event<T> {
return manualSyncTaskChannel.listen(event, arg);
}
};
}
async preview(): Promise<[SyncResource, ISyncResourcePreview][]> {