This commit is contained in:
Anna Kocheshkova 2018-05-02 13:25:08 +03:00 коммит произвёл GitHub
Родитель a8372586e6
Коммит 940bc4bc2f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 11 добавлений и 13 удалений

Просмотреть файл

@ -16,11 +16,8 @@ export default class LinkAppCenter extends LinkCommand {
return;
}
if (this.CachedApps) {
this.showAppsQuickPick(this.CachedApps, true, false, Strings.ProvideSecondAppPromptMsg);
} else {
this.refreshCachedAppsAndRepaintQuickPickIfNeeded(true, false, false, Strings.ProvideFirstAppPromptMsg);
}
this.showAppsQuickPick(this.CachedApps, true, false, Strings.ProvideSecondAppPromptMsg);
this.refreshCachedAppsAndRepaintQuickPickIfNeeded(true, false, false, Strings.ProvideFirstAppPromptMsg);
}
protected async linkApps(): Promise<boolean> {

Просмотреть файл

@ -17,8 +17,6 @@ export class LinkCommand extends ReactNativeAppCommand {
}
protected async handleShowCurrentAppQuickPickSelection(selected: QuickPickAppItem, _rnApps: models.AppResponse[]) {
this.userAlreadySelectedApp = false;
let currentApp: CurrentApp | null;
if (selected.target === this.currentAppMenuTarget) {
currentApp = await this.getCurrentApp();
@ -46,7 +44,7 @@ export class LinkCommand extends ReactNativeAppCommand {
});
const current: CurrentApp | null = await this.getCurrentApp();
const showCurrentApp: boolean = current.os.toLowerCase() !== currentApp.os.toLowerCase();
this.showAppsQuickPick(cachedFilteredApps, showCurrentApp, false, Strings.ProvideSecondAppPromptMsg);
this.showAppsQuickPick(cachedFilteredApps, showCurrentApp, false, Strings.ProvideSecondAppPromptMsg, true);
} else {
this.linkApps();
}

Просмотреть файл

@ -52,9 +52,10 @@ export class ReactNativeAppCommand extends Command {
if (profile && profile.currentApp) {
if (refreshDeployments) {
try {
const result: models.Deployment = await this.client.codePushDeployments.get(Constants.CodePushStagingDeploymentName, profile.currentApp.ownerName, profile.currentApp.appName);
const result: models.Deployment[] = await this.client.codePushDeployments.list(profile.currentApp.ownerName, profile.currentApp.appName);
if (result) {
profile.currentApp.currentAppDeployments.codePushDeployments.push(result);
profile.currentApp.currentAppDeployments.codePushDeployments = [];
profile.currentApp.currentAppDeployments.codePushDeployments.push(...result);
profile.currentApp.currentAppDeployments.currentDeploymentName = Constants.CodePushStagingDeploymentName;
}
} catch (err) { }
@ -70,12 +71,14 @@ export class ReactNativeAppCommand extends Command {
throw Error("handleShowCurrentAppQuickPickSelection not implemented in base class");
}
protected async showAppsQuickPick(rnApps: models.AppResponse[], includeSelectCurrent: boolean = false, includeCreateNew: boolean = true, prompt: string = Strings.ProvideCurrentAppPromptMsg) {
protected async showAppsQuickPick(rnApps: models.AppResponse[], includeSelectCurrent: boolean = false, includeCreateNew: boolean = true, prompt: string = Strings.ProvideCurrentAppPromptMsg, force: boolean = false) {
if (!rnApps) {
this.logger.debug("Do not show apps quick pick due to no apps (either in cache or fetched from server");
return;
}
ReactNativeAppCommand.cachedApps = rnApps;
if (!force) {
ReactNativeAppCommand.cachedApps = rnApps;
}
const options: QuickPickAppItem[] = MenuHelper.getQuickPickItemsForAppsList(rnApps);
if (includeCreateNew) {
const createNewAppItem = {
@ -97,7 +100,7 @@ export class ReactNativeAppCommand extends Command {
options.splice(0, 0, currentAppItem);
}
}
if (!this.userAlreadySelectedApp) {
if (!this.userAlreadySelectedApp || force) {
vscode.window.showQuickPick(options, { placeHolder: prompt })
.then((selected: QuickPickAppItem) => {
this.userAlreadySelectedApp = true;