未验证 提交 b98c3f7d 编写于 作者: X XVincentX

Add hasChangelog method to display the tab eventually

上级 23815a07
......@@ -254,7 +254,10 @@ export class ExtensionEditor extends BaseEditor {
this.navbar.onChange(this.onNavbarChange.bind(this, extension), this, this.transientDisposables);
this.navbar.push(NavbarSection.Readme, localize('details', "Details"));
this.navbar.push(NavbarSection.Contributions, localize('contributions', "Contributions"));
this.navbar.push(NavbarSection.Changelog, localize('changelog', "Changelog"));
if (extension.hasChangelog) {
this.navbar.push(NavbarSection.Changelog, localize('changelog', "Changelog"));
}
this.content.innerHTML = '';
......
......@@ -42,6 +42,7 @@ export interface IExtension {
telemetryData: any;
getManifest(): TPromise<IExtensionManifest>;
getReadme(): TPromise<string>;
hasChangelog : boolean;
getChangelog() : TPromise<string>;
}
......
......@@ -187,6 +187,10 @@ class Extension implements IExtension {
return this.galleryService.getAsset(readmeUrl).then(asText);
}
get hasChangelog() : boolean {
return !!(this.local && this.local.changelogUrl ? this.local.changelogUrl : '');
}
getChangelog() : TPromise<string> {
const changelogUrl = this.local && this.local.changelogUrl ? this.local.changelogUrl : '';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册