mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 00:56:06 +00:00
wip fix(core): writeProfile avoid deleting profile fields one by one
This commit is contained in:
@@ -120,11 +120,10 @@ export class ProfilesService {
|
|||||||
async writeProfile (profile: PartialProfile<Profile>, saveConfig = true): Promise<void> {
|
async writeProfile (profile: PartialProfile<Profile>, saveConfig = true): Promise<void> {
|
||||||
const cProfile = this.config.store.profiles.find(p => p.id === profile.id)
|
const cProfile = this.config.store.profiles.find(p => p.id === profile.id)
|
||||||
if (cProfile) {
|
if (cProfile) {
|
||||||
// Fully replace the config
|
if (!profile.group) {
|
||||||
for (const k in cProfile) {
|
delete cProfile.group
|
||||||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
||||||
delete cProfile[k]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(cProfile, profile)
|
Object.assign(cProfile, profile)
|
||||||
|
|
||||||
if (saveConfig) {
|
if (saveConfig) {
|
||||||
|
Reference in New Issue
Block a user