mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-08 13:30:02 +00:00
fix Eugeny/tabby#8534 : skip yaml unacceptable kind of object to dump
This commit is contained in:
parent
6709217a86
commit
82a262026f
@ -205,7 +205,7 @@ export class ConfigService {
|
|||||||
// Scrub undefined values
|
// Scrub undefined values
|
||||||
let cleanStore = JSON.parse(JSON.stringify(this._store))
|
let cleanStore = JSON.parse(JSON.stringify(this._store))
|
||||||
cleanStore = await this.maybeEncryptConfig(cleanStore)
|
cleanStore = await this.maybeEncryptConfig(cleanStore)
|
||||||
await this.platform.saveConfig(yaml.dump(cleanStore))
|
await this.platform.saveConfig(yaml.dump(cleanStore, {skipInvalid: true}))
|
||||||
this.emitChange()
|
this.emitChange()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ export class ConfigService {
|
|||||||
* Reads config YAML as string
|
* Reads config YAML as string
|
||||||
*/
|
*/
|
||||||
readRaw (): string {
|
readRaw (): string {
|
||||||
return yaml.dump(this._store)
|
return yaml.dump(this._store, {skipInvalid: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,7 +97,7 @@ export class ConfigSyncService {
|
|||||||
data[part] = remoteData[part]
|
data[part] = remoteData[part]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const content = yaml.dump(data)
|
const content = yaml.dump(data, {skipInvalid: true})
|
||||||
const result = await this.updateConfig(this.config.store.configSync.configID, {
|
const result = await this.updateConfig(this.config.store.configSync.configID, {
|
||||||
content,
|
content,
|
||||||
last_used_with_version: this.platform.getAppVersion(),
|
last_used_with_version: this.platform.getAppVersion(),
|
||||||
@ -154,7 +154,7 @@ export class ConfigSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async writeConfigDataFromSync (data: any) {
|
private async writeConfigDataFromSync (data: any) {
|
||||||
await this.platform.saveConfig(yaml.dump(data))
|
await this.platform.saveConfig(yaml.dump(data, {skipInvalid: true}))
|
||||||
await this.config.load()
|
await this.config.load()
|
||||||
await this.config.save()
|
await this.config.save()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user