diff --git a/lib/gui/app/models/leds.ts b/lib/gui/app/models/leds.ts index 61013bb2e6..8c5329428a 100644 --- a/lib/gui/app/models/leds.ts +++ b/lib/gui/app/models/leds.ts @@ -245,16 +245,16 @@ export async function init(): Promise { for (const [drivePath, ledsNames] of Object.entries(ledsMapping)) { leds.set('/dev/disk/by-path/' + drivePath, new RGBLed(ledsNames)); } + ledColors = (await settings.get('ledColors')) || {}; + ledAnimationFunctions = { + blinkGreen: createAnimationFunction(blink, ledColors['green']), + blinkPurple: createAnimationFunction(blink, ledColors['purple']), + staticRed: createAnimationFunction(one, ledColors['red']), + staticGreen: createAnimationFunction(one, ledColors['green']), + staticBlue: createAnimationFunction(one, ledColors['blue']), + staticWhite: createAnimationFunction(one, ledColors['white']), + staticBlack: createAnimationFunction(one, ledColors['black']), + }; + observe(_.debounce(stateObserver, 1000, { maxWait: 1000 })); } - ledColors = (await settings.get('ledColors')) || {}; - ledAnimationFunctions = { - blinkGreen: createAnimationFunction(blink, ledColors['green']), - blinkPurple: createAnimationFunction(blink, ledColors['purple']), - staticRed: createAnimationFunction(one, ledColors['red']), - staticGreen: createAnimationFunction(one, ledColors['green']), - staticBlue: createAnimationFunction(one, ledColors['blue']), - staticWhite: createAnimationFunction(one, ledColors['white']), - staticBlack: createAnimationFunction(one, ledColors['black']), - }; - observe(_.debounce(stateObserver, 1000, { maxWait: 1000 })); }