mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Fix #102001
This commit is contained in:
@@ -357,6 +357,18 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
||||
}
|
||||
}
|
||||
|
||||
async resetSyncedData(): Promise<void> {
|
||||
const result = await this.dialogService.confirm({
|
||||
message: localize('reset', "This will clear your synced data from the cloud and stop sync on all your devices."),
|
||||
title: localize('reset title', "Reset Synced Data"),
|
||||
type: 'info',
|
||||
primaryButton: localize('reset button', "Reset"),
|
||||
});
|
||||
if (result.confirmed) {
|
||||
await this.userDataSyncService.resetRemote();
|
||||
}
|
||||
}
|
||||
|
||||
private isSupportedAuthenticationProviderId(authenticationProviderId: string): boolean {
|
||||
return this.authenticationProviders.some(({ id }) => id === authenticationProviderId);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ export interface IUserDataSyncWorkbenchService {
|
||||
turnOn(): Promise<void>;
|
||||
turnoff(everyWhere: boolean): Promise<void>;
|
||||
signIn(): Promise<void>;
|
||||
resetSyncedData(): Promise<void>;
|
||||
}
|
||||
|
||||
export function getSyncAreaLabel(source: SyncResource): string {
|
||||
|
||||
@@ -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][]> {
|
||||
|
||||
Reference in New Issue
Block a user