From b135f62c18e9d312278942eb1e77bea9b1535999 Mon Sep 17 00:00:00 2001 From: Robert Kossessa Date: Thu, 6 Jun 2024 17:04:34 +0200 Subject: [PATCH] UPD: Annotate unused function --- src/renderer/src/deviceStore.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/deviceStore.ts b/src/renderer/src/deviceStore.ts index 18e9d21..1858ff3 100644 --- a/src/renderer/src/deviceStore.ts +++ b/src/renderer/src/deviceStore.ts @@ -118,6 +118,9 @@ const { nanoIpc } = window const messageCallbacks: ((title: string, message: string) => void)[] = [] +// Helper function to create an array with a single value at a specific index +// The idea is to save space by only sending the updated value to the device +// The firmware doesn't appear to handle this correctly atm :( const createUpdateArray = (index: number, value) => { const arr = Array(index + 1).fill({}) arr[index] = value @@ -645,7 +648,9 @@ export const useDeviceStore = defineStore('device', { this.currentDeviceId!, JSON.stringify({ profile: this.currentProfileName, - updates: { knob: this.currentProfile!.knob } + updates: { + knob: this.currentProfile!.knob + } }) ) this.setDirtyState(true) @@ -660,7 +665,9 @@ export const useDeviceStore = defineStore('device', { this.currentDeviceId!, JSON.stringify({ profile: this.currentProfileName, - updates: { knob: this.currentProfile!.knob } + updates: { + knob: this.currentProfile!.knob + } }) ) this.setDirtyState(true)