From 220a63994898fd65503fee2cd7ffc97d2583a2a5 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Thu, 29 Jul 2021 06:23:14 +0200 Subject: handled all node color cases --- components/tweaks.tsx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'components') diff --git a/components/tweaks.tsx b/components/tweaks.tsx index 709cbf5..bd607b7 100644 --- a/components/tweaks.tsx +++ b/components/tweaks.tsx @@ -372,6 +372,9 @@ export const Tweaks = (props: TweakProps) => { type="checkbox" defaultValue={visuals.nodeColorScheme} onChange={(colors) => { + if (!colors.length) { + return + } setVisuals({ ...visuals, nodeColorScheme: colors }) console.log(visuals.nodeColorScheme) }} @@ -383,6 +386,10 @@ export const Tweaks = (props: TweakProps) => { (c) => c === color, )} value={color} + isDisabled={ + visuals.nodeColorScheme.length === 1 && + visuals.nodeColorScheme[0] === color + } >