From 8802788e060760ddbd0b6e307910294ca08d9f57 Mon Sep 17 00:00:00 2001 From: YeonV Date: Fri, 14 Feb 2025 18:54:03 +0100 Subject: [PATCH] test config migrator --- src/store/migrate.ts | 36 +++++++++++++++++++++++++++++++++++- src/utils/helpers.ts | 2 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/store/migrate.ts b/src/store/migrate.ts index ef4205c5..0fcd3231 100644 --- a/src/store/migrate.ts +++ b/src/store/migrate.ts @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { produce } from 'immer' +import { Ledfx } from '../api/ledfx' export interface MigrationState { [key: string]: any @@ -44,5 +45,38 @@ export const migrations: Migrations = { }), 16: (state) => ({ ...state }), - 17: (state) => ({ ...state }) + 17: (state) => ({ ...state }), + 18: (state) => ({ + ...state, + updateScene: async ( + name: string, + id: string, + scene_image?: string | null, + scene_tags?: string | null, + scene_puturl?: string | null, + scene_payload?: string | null, + scene_midiactivate?: string | null, + virtuals?: Record + ) => + virtuals + ? await Ledfx('/api/scenes', 'POST', { + name, + id, + scene_image, + scene_tags, + scene_puturl, + scene_payload, + scene_midiactivate, + virtuals + }) + : await Ledfx('/api/scenes', 'POST', { + name, + id, + scene_image, + scene_tags, + scene_puturl, + scene_payload, + scene_midiactivate + }) + }) } diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index f195d736..f7a654af 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -3,7 +3,7 @@ import { IMCell } from '../pages/Devices/EditVirtuals/EditMatrix/M.utils' export const drawerWidth = 240 -export const frontendConfig = 17 +export const frontendConfig = 18 export const formatTime = (dura: number) => { let seconds: string | number