From b776f236449a97e288493717c1a0fc4630ef9799 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 18 Jul 2023 15:40:16 -0400
Subject: fixing focusing with DocFocusOrOpen when target is a data Proto.

---
 src/client/views/StyleProvider.tsx | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'src/client/views/StyleProvider.tsx')

diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index 2d4fce899..c7616a9ba 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -323,13 +323,12 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps
 }
 
 export function DashboardToggleButton(doc: Doc, field: string, onIcon: IconProp, offIcon: IconProp, clickFunc?: () => void) {
-    const color = StrCast(Doc.UserDoc().userColor)
-    if (!doc[field]) return null
+    const color = StrCast(Doc.UserDoc().userColor);
     return (
         <IconButton
             size={Size.XSMALL}
             color={color}
-            icon={<FontAwesomeIcon icon={(doc[field] ? (onIcon as any) : offIcon) as IconProp}/>}
+            icon={<FontAwesomeIcon icon={(doc[field] ? (onIcon as any) : offIcon) as IconProp} />}
             onClick={undoBatch(
                 action((e: React.MouseEvent) => {
                     e.stopPropagation();
@@ -343,9 +342,8 @@ export function DashboardToggleButton(doc: Doc, field: string, onIcon: IconProp,
  * add lock and hide button decorations for the "Dashboards" flyout TreeView
  */
 export function DashboardStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps | DocumentViewProps>, property: string) {
-
     if (doc && property.split(':')[0] === StyleProp.Decorations) {
-        return doc._type_collection === CollectionViewType.Docking
+        return doc._type_collection === CollectionViewType.Docking || Doc.IsSystem(doc)
             ? null
             : DashboardToggleButton(doc, 'hidden', 'eye-slash', 'eye', () => DocFocusOrOpen(doc, { toggleTarget: true, willZoomCentered: true, zoomScale: 0 }, DocCast(doc?.embedContainer ?? doc?.annotationOn)));
     }
-- 
cgit v1.2.3-70-g09d2

