1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Pull derived selected screen store out of main screen store

This commit is contained in:
Andrew Kingston 2024-02-05 11:24:34 +00:00
parent 1650f37329
commit b04d92f8b2

View file

@ -39,12 +39,6 @@ export class ScreenStore extends BudiStore {
this.sequentialScreenPatch = this.sequentialScreenPatch.bind(this)
this.removeCustomLayout = this.removeCustomLayout.bind(this)
this.selected = derived(this.store, $store => {
return get(this.store).screens.find(
screen => screen._id === $store.selectedScreenId
)
})
this.history = createHistoryStore({
getDoc: id => get(this.store).screens?.find(screen => screen._id === id),
selectDoc: this.select,
@ -485,7 +479,9 @@ export class ScreenStore extends BudiStore {
export const screenStore = new ScreenStore()
export const selectedScreen = screenStore.selected
export const selectedScreen = derived(screenStore, $store => {
return $store.screens.find(screen => screen._id === $store.selectedScreenId)
})
export const currentAsset = selectedScreen