mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-20 11:29:56 +00:00
Deepclone profile before passing it to the configuration component and fix uncaught error on modal dismiss
This commit is contained in:
parent
8ff130ebfd
commit
905e7ffc43
@ -100,10 +100,10 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
|||||||
if (!provider) {
|
if (!provider) {
|
||||||
throw new Error('Cannot edit a profile without a provider')
|
throw new Error('Cannot edit a profile without a provider')
|
||||||
}
|
}
|
||||||
modal.componentInstance.profile = Object.assign({}, profile)
|
modal.componentInstance.profile = deepClone(profile)
|
||||||
modal.componentInstance.profileProvider = provider
|
modal.componentInstance.profileProvider = provider
|
||||||
|
try {
|
||||||
const result = await modal.result
|
const result = await modal.result
|
||||||
|
|
||||||
// Fully replace the config
|
// Fully replace the config
|
||||||
for (const k in profile) {
|
for (const k in profile) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
||||||
@ -112,6 +112,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
|||||||
Object.assign(profile, result)
|
Object.assign(profile, result)
|
||||||
|
|
||||||
profile.type = provider.id
|
profile.type = provider.id
|
||||||
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteProfile (profile: PartialProfile<Profile>): Promise<void> {
|
async deleteProfile (profile: PartialProfile<Profile>): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user