mirror of
https://github.com/coder/code-server.git
synced 2025-07-31 22:13:52 +08:00
refactor: write lastVisited
and query
at the same time
In addition, the `settings.write` method now uses shallow merge by default
This commit is contained in:
@ -30,9 +30,9 @@ export class SettingsProvider<T> {
|
||||
|
||||
/**
|
||||
* Write settings combined with current settings. On failure log a warning.
|
||||
* Objects will be merged and everything else will be replaced.
|
||||
* Settings can be shallow or deep merged.
|
||||
*/
|
||||
public async write(settings: Partial<T>, shallow?: boolean): Promise<void> {
|
||||
public async write(settings: Partial<T>, shallow = true): Promise<void> {
|
||||
try {
|
||||
const oldSettings = await this.read()
|
||||
const nextSettings = shallow ? Object.assign({}, oldSettings, settings) : extend(oldSettings, settings)
|
||||
|
Reference in New Issue
Block a user