mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-28 15:29:58 +00:00
lint
This commit is contained in:
parent
4d146941f4
commit
21df033012
@ -16,7 +16,7 @@ export { BootstrapData, PluginInfo, BOOTSTRAP_DATA } from './mainProcess'
|
|||||||
export { HostWindowService } from './hostWindow'
|
export { HostWindowService } from './hostWindow'
|
||||||
export { HostAppService, Platform } from './hostApp'
|
export { HostAppService, Platform } from './hostApp'
|
||||||
export { FileProvider } from './fileProvider'
|
export { FileProvider } from './fileProvider'
|
||||||
export { ProfileProvider, Profile, PartialProfile, ProfileSettingsComponent, ProfileGroup, PartialProfileGroup} from './profileProvider'
|
export { ProfileProvider, Profile, PartialProfile, ProfileSettingsComponent, ProfileGroup, PartialProfileGroup } from './profileProvider'
|
||||||
export { PromptModalComponent } from '../components/promptModal.component'
|
export { PromptModalComponent } from '../components/promptModal.component'
|
||||||
export * from './commands'
|
export * from './commands'
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ export class ConfigService {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
let group = groups.find(x => x.name === (p.group))
|
let group = groups.find(x => x.name === p.group)
|
||||||
if (!group) {
|
if (!group) {
|
||||||
group = {
|
group = {
|
||||||
id: `${uuidv4()}`,
|
id: `${uuidv4()}`,
|
||||||
@ -387,6 +387,7 @@ export class ConfigService {
|
|||||||
for (const g of groups) {
|
for (const g of groups) {
|
||||||
if (profileGroupCollapsed[g.name]) {
|
if (profileGroupCollapsed[g.name]) {
|
||||||
const collapsed = profileGroupCollapsed[g.name]
|
const collapsed = profileGroupCollapsed[g.name]
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
||||||
delete profileGroupCollapsed[g.name]
|
delete profileGroupCollapsed[g.name]
|
||||||
profileGroupCollapsed[g.id] = collapsed
|
profileGroupCollapsed[g.id] = collapsed
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,6 @@ export class ProfilesService {
|
|||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
providerForProfile <T extends Profile> (profile: PartialProfile<T>): ProfileProvider<T>|null {
|
providerForProfile <T extends Profile> (profile: PartialProfile<T>): ProfileProvider<T>|null {
|
||||||
const provider = this.profileProviders.find(x => x.id === profile.type) ?? null
|
const provider = this.profileProviders.find(x => x.id === profile.type) ?? null
|
||||||
return provider as unknown as ProfileProvider<T>|null
|
return provider as unknown as ProfileProvider<T>|null
|
||||||
@ -248,7 +246,8 @@ export class ProfilesService {
|
|||||||
/**
|
/**
|
||||||
* Set global defaults for a given profile provider
|
* Set global defaults for a given profile provider
|
||||||
*/
|
*/
|
||||||
setProviderDefaults (provider: ProfileProvider<Profile>, pdefaults: any) {
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||||
|
setProviderDefaults (provider: ProfileProvider<Profile>, pdefaults: any): void {
|
||||||
this.config.store.profileDefaults[provider.id] = pdefaults
|
this.config.store.profileDefaults[provider.id] = pdefaults
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +283,7 @@ export class ProfilesService {
|
|||||||
let groups: PartialProfileGroup<ProfileGroup>[] = this.config.store.groups ?? []
|
let groups: PartialProfileGroup<ProfileGroup>[] = this.config.store.groups ?? []
|
||||||
groups = groups.map(x => {
|
groups = groups.map(x => {
|
||||||
x.editable = true
|
x.editable = true
|
||||||
x.collapsed = profileGroupCollapsed[x.id ?? ''] ?? false
|
x.collapsed = profileGroupCollapsed[x.id] ?? false
|
||||||
|
|
||||||
if (includeProfiles) {
|
if (includeProfiles) {
|
||||||
x.profiles = profiles.filter(p => p.group === x.id)
|
x.profiles = profiles.filter(p => p.group === x.id)
|
||||||
@ -326,7 +325,7 @@ export class ProfilesService {
|
|||||||
/**
|
/**
|
||||||
* Save ProfileGroup collapse state in localStorage
|
* Save ProfileGroup collapse state in localStorage
|
||||||
*/
|
*/
|
||||||
saveProfileGroupCollapse(group: PartialProfileGroup<ProfileGroup>) {
|
saveProfileGroupCollapse (group: PartialProfileGroup<ProfileGroup>): void {
|
||||||
const profileGroupCollapsed = JSON.parse(window.localStorage.profileGroupCollapsed ?? '{}')
|
const profileGroupCollapsed = JSON.parse(window.localStorage.profileGroupCollapsed ?? '{}')
|
||||||
profileGroupCollapsed[group.id] = group.collapsed
|
profileGroupCollapsed[group.id] = group.collapsed
|
||||||
window.localStorage.profileGroupCollapsed = JSON.stringify(profileGroupCollapsed)
|
window.localStorage.profileGroupCollapsed = JSON.stringify(profileGroupCollapsed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user