mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Init assets in dialog model (#15533)
* check that there are assets before filtering * init assets as empty array
This commit is contained in:
@@ -250,13 +250,15 @@ export class RemoteBookDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async fillVersionDropdown(): Promise<void> {
|
public async fillVersionDropdown(): Promise<void> {
|
||||||
let filtered_assets = (await this.controller.getAssets()).filter(asset => asset.book === this.bookDropdown.value);
|
const assets = await this.controller.getAssets();
|
||||||
|
let filtered_assets = assets.filter(asset => asset.book === this.bookDropdown.value);
|
||||||
this.versionDropdown.values = ['-'].concat(filtered_assets.map(asset => asset.version));
|
this.versionDropdown.values = ['-'].concat(filtered_assets.map(asset => asset.version));
|
||||||
this.checkValues();
|
this.checkValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async fillLanguageDropdown(): Promise<void> {
|
public async fillLanguageDropdown(): Promise<void> {
|
||||||
let filtered_assets = (await this.controller.getAssets()).filter(asset => asset.book === this.bookDropdown.value &&
|
const assets = await this.controller.getAssets();
|
||||||
|
let filtered_assets = assets.filter(asset => asset.book === this.bookDropdown.value &&
|
||||||
asset.version === this.versionDropdown.value);
|
asset.version === this.versionDropdown.value);
|
||||||
this.languageDropdown.values = ['-'].concat(filtered_assets.map(asset => asset.language));
|
this.languageDropdown.values = ['-'].concat(filtered_assets.map(asset => asset.language));
|
||||||
this.checkValues();
|
this.checkValues();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { IRelease, IAsset } from '../book/remoteBookController';
|
|||||||
export class RemoteBookDialogModel {
|
export class RemoteBookDialogModel {
|
||||||
private _remoteLocation: string;
|
private _remoteLocation: string;
|
||||||
private _releases: IRelease[] = [];
|
private _releases: IRelease[] = [];
|
||||||
private _assets: IAsset[];
|
private _assets: IAsset[] = [];
|
||||||
private _book: RemoteBook;
|
private _book: RemoteBook;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|||||||
Reference in New Issue
Block a user