1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-23 05:03:36 +03:00
This commit is contained in:
Clem 2023-07-07 15:15:13 +02:00
parent 82a262026f
commit a4136bec6e
3 changed files with 9 additions and 9 deletions

View File

@ -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, {skipInvalid: true})) 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, {skipInvalid: true}) return yaml.dump(this._store, { skipInvalid: true })
} }
/** /**

View File

@ -97,7 +97,7 @@ export class ConfigSyncService {
data[part] = remoteData[part] data[part] = remoteData[part]
} }
} }
const content = yaml.dump(data, {skipInvalid: true}) 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, {skipInvalid: true})) 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()
} }

View File

@ -1,6 +1,6 @@
import { Injectable, Optional, Inject } from '@angular/core' import { Injectable, Optional, Inject } from '@angular/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, TranslateService, SplitTabComponent, PromptModalComponent, ConfigService, PartialProfile, Profile} from 'tabby-core' import { BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, TranslateService, SplitTabComponent, PromptModalComponent, ConfigService, PartialProfile, Profile } from 'tabby-core'
import { BaseTerminalTabComponent } from './api/baseTerminalTab.component' import { BaseTerminalTabComponent } from './api/baseTerminalTab.component'
import { TerminalContextMenuItemProvider } from './api/contextMenuProvider' import { TerminalContextMenuItemProvider } from './api/contextMenuProvider'
import { MultifocusService } from './services/multifocus.service' import { MultifocusService } from './services/multifocus.service'
@ -180,8 +180,8 @@ export class SaveAsProfileContextMenu extends TabContextMenuItemProvider {
return return
} }
let options = { const options = {
...tab.profile.options ...tab.profile.options,
} }
const cwd = await tab.session?.getWorkingDirectory() ?? tab.profile.options.cwd const cwd = await tab.session?.getWorkingDirectory() ?? tab.profile.options.cwd
@ -192,7 +192,7 @@ export class SaveAsProfileContextMenu extends TabContextMenuItemProvider {
const profile: PartialProfile<Profile> = { const profile: PartialProfile<Profile> = {
type: tab.profile.type, type: tab.profile.type,
name, name,
options options,
} }
profile.id = `${profile.type}:custom:${slugify(name)}:${uuidv4()}` profile.id = `${profile.type}:custom:${slugify(name)}:${uuidv4()}`
@ -215,4 +215,4 @@ export class SaveAsProfileContextMenu extends TabContextMenuItemProvider {
return [] return []
} }
} }