提交 bbc2da76 编写于 作者: S Sandeep Somavarapu

fix token check

上级 f1ad6792
......@@ -364,6 +364,8 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
if (this.authenticationState.get() === MSAAuthStatus.SignedOut) {
await this.signIn();
}
await this.handleFirstTimeSync();
await this.configurationService.updateValue(UserDataSyncWorkbenchContribution.ENABLEMENT_SETTING, true);
this.notificationService.info(localize('Sync Started', "Sync Started."));
}
......@@ -413,6 +415,34 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
});
}
private async handleFirstTimeSync(): Promise<void> {
const hasRemote = await this.userDataSyncService.hasRemote();
const hasPreviouslySynced = await this.userDataSyncService.hasPreviouslySynced();
if (hasRemote && !hasPreviouslySynced) {
const result = await this.dialogService.show(
Severity.Info,
localize('firs time sync', "First time synchronization"),
[
localize('continue', "Continue"),
localize('cancel', "Cancel"),
localize('download', "Download"),
localize('upload', "Upload"),
],
{
cancelId: 1,
detail: localize('first time sync detail', "Synchronising from this device for the first time. Would you like to \nDownload and replace with the remote data or \nUpload from this device and replace the remote data?")
}
);
switch (result.choice) {
case 2: return this.userDataSyncService.pull();
case 3: return this.userDataSyncService.push();
}
}
}
private async turnOff(): Promise<void> {
const result = await this.dialogService.confirm({
type: 'info',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册