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
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
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
this.recoveryStateChangedHint.next()
this.onAfterTabAdded(newTab)
this.updateTitle()
}
/**

View file

@ -37,13 +37,6 @@ export class ProfilesService {
if (params) {
const tab = this.app.openNewTab(params)
;(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 null
@ -51,7 +44,15 @@ export class ProfilesService {
async newTabParametersForProfile <P extends Profile> (profile: PartialProfile<P>): Promise<NewTabParameters<BaseTabComponent>|null> {
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>[] {