From 389bc19f47310e263aa2490b371e9eeaec3df2cd Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Wed, 2 Oct 2024 14:55:40 +0100 Subject: [PATCH] fix users not showing - they arent base64 encoded --- app/components/InstrumentData.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/components/InstrumentData.tsx b/app/components/InstrumentData.tsx index e8237d5..79ddc16 100644 --- a/app/components/InstrumentData.tsx +++ b/app/components/InstrumentData.tsx @@ -215,10 +215,18 @@ export default function InstrumentData({ updatedPVbytes != null ) { // this is a top bar column zero value - const row = updatedPVName.endsWith("TITLE") ? 0 : 1; // if title, column 1 - // Both of these are base64 encoded. PVWS gives a null byte back if there is no value, so replace with null. - const value = - atob(updatedPVbytes) != "\x00" ? atob(updatedPVbytes) : null; + const isTitle = updatedPVName.endsWith("TITLE") + + let value; + if (isTitle) { + // The title is base64 encoded. PVWS gives a null byte back if there is no value, so replace with null. + value = atob(updatedPVbytes) != "\x00" ? atob(updatedPVbytes) : null; + } else { + value = updatedPV.text + } + + const row = isTitle ? 0 : 1; // if title, column 1 + currentInstrument.topBarPVs.set(updatedPVName, [ row, 0,