fixed #4586 - fix disableDynamicTabTitle to work with switch-profile

This commit is contained in:
Eugene Pankov
2021-09-24 23:55:19 +02:00
parent ed71b499b9
commit 3923e46f22
2 changed files with 10 additions and 8 deletions

View File

@@ -483,6 +483,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
newTab.parent = this newTab.parent = this
this.recoveryStateChangedHint.next() this.recoveryStateChangedHint.next()
this.onAfterTabAdded(newTab) this.onAfterTabAdded(newTab)
this.updateTitle()
} }
/** /**

View File

@@ -37,13 +37,6 @@ export class ProfilesService {
if (params) { if (params) {
const tab = this.app.openNewTab(params) const tab = this.app.openNewTab(params)
;(this.app.getParentTab(tab) ?? tab).color = profile.color ?? null ;(this.app.getParentTab(tab) ?? tab).color = profile.color ?? null
if (profile.name) {
tab.setTitle(profile.name)
}
if (profile.disableDynamicTitle) {
tab['disableDynamicTitle'] = true
}
return tab return tab
} }
return null return null
@@ -51,7 +44,15 @@ export class ProfilesService {
async newTabParametersForProfile <P extends Profile> (profile: PartialProfile<P>): Promise<NewTabParameters<BaseTabComponent>|null> { async newTabParametersForProfile <P extends Profile> (profile: PartialProfile<P>): Promise<NewTabParameters<BaseTabComponent>|null> {
const fullProfile = this.getConfigProxyForProfile(profile) const fullProfile = this.getConfigProxyForProfile(profile)
return this.providerForProfile(fullProfile)?.getNewTabParameters(fullProfile) ?? null const params = await this.providerForProfile(fullProfile)?.getNewTabParameters(fullProfile) ?? null
if (params) {
params.inputs ??= {}
params.inputs['title'] = profile.name
if (profile.disableDynamicTitle) {
params.inputs['disableDynamicTitle'] = true
}
}
return params
} }
getProviders (): ProfileProvider<Profile>[] { getProviders (): ProfileProvider<Profile>[] {