Move selected layout out of layout store

This commit is contained in:
Andrew Kingston 2024-02-05 11:29:39 +00:00
parent 48677aeaab
commit ff499d1461
1 changed files with 3 additions and 7 deletions

View File

@ -16,12 +16,6 @@ export class LayoutStore extends BudiStore {
this.syncAppLayouts = this.syncAppLayouts.bind(this) this.syncAppLayouts = this.syncAppLayouts.bind(this)
this.select = this.select.bind(this) this.select = this.select.bind(this)
this.deleteLayout = this.deleteLayout.bind(this) this.deleteLayout = this.deleteLayout.bind(this)
this.selectedLayout = derived(this.store, $store => {
return $store.layouts?.find(
layout => layout._id === $store.selectedLayoutId
)
})
} }
reset() { reset() {
@ -78,4 +72,6 @@ export class LayoutStore extends BudiStore {
export const layoutStore = new LayoutStore() export const layoutStore = new LayoutStore()
export const selectedLayout = layoutStore.selectedLayout export const selectedLayout = derived(layoutStore, $store => {
return $store.layouts?.find(layout => layout._id === $store.selectedLayoutId)
})