Skip to content

Commit

Permalink
fix: reload backlight colors on mode change
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Jan 7, 2024
1 parent 95386e7 commit 0ccd7d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/entities/lights/model/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createEffect, createEvent, createStore, sample } from 'effector'
import { interval } from 'patronum'

import { createSequence } from '$shared/lib'
import { connected, disconnected } from '$shared/model'
import { connected, disconnected, modeSettingsChanged } from '$shared/model'

import { getBacklightColors, setBacklightColor } from '../api/color'
import { getModes } from '../api/mode'
Expand Down Expand Up @@ -82,6 +82,10 @@ sample({
clock: connected,
target: [getModesFx, getBacklightColorsFx]
})
sample({
clock: modeSettingsChanged,
target: getBacklightColorsFx
})
modesStore.on(getModesFx.doneData, (_, modes) => modes)
backlightColorsStore.on(getBacklightColorsFx.doneData, (_, colors) => colors)

Expand Down

0 comments on commit 0ccd7d8

Please sign in to comment.