From 8c5fd1eb3c1ffb5bc17f5225a75f9dd2db40e460 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 13 Sep 2021 15:36:58 -0400
Subject: from last

---
 src/client/views/nodes/button/FontIconBox.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/client/views/nodes/button/FontIconBox.tsx')

diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx
index 40d5ad819..1997f4fa5 100644
--- a/src/client/views/nodes/button/FontIconBox.tsx
+++ b/src/client/views/nodes/button/FontIconBox.tsx
@@ -352,11 +352,8 @@ export class FontIconBox extends DocComponent<ButtonProps, FontIconDocument>(Fon
         </div>;
 
         const click = (value: ColorState) => {
-            const hex: string = value.hex;
             const s = ScriptField.MakeScript(script + '("' + Utils.colorString(value) + '", false)');
-            if (s) {
-                undoBatch(() => s.script.run().result)();
-            }
+            s && undoBatch(() => s.script.run().result)();
         };
         return (
             <div className={`menuButton ${this.type} ${active}`}
@@ -589,6 +586,9 @@ Scripting.addGlobal(function setBackgroundColor(color?: string, checkResult?: bo
 
 // toggle: Set overlay status of selected document
 Scripting.addGlobal(function setHeaderColor(color?: string, checkResult?: boolean) {
+    if (checkResult) {
+        return Doc.SharingDoc().userColor;
+    }
     Doc.SharingDoc().userColor = undefined;
     Doc.GetProto(Doc.SharingDoc()).userColor = color;
     Doc.UserDoc().showTitle = color === "transparent" ? undefined : StrCast(Doc.UserDoc().showTitle, "creationDate");
-- 
cgit v1.2.3-70-g09d2

