diff options
Diffstat (limited to 'src/client/views/topbar')
| -rw-r--r-- | src/client/views/topbar/TopBar.tsx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx index 5d8583873..9b24219cf 100644 --- a/src/client/views/topbar/TopBar.tsx +++ b/src/client/views/topbar/TopBar.tsx @@ -3,10 +3,9 @@ import { Button, Dropdown, DropdownType, IconButton, isDark, Size, Type } from ' import { action, computed, makeObservable, observable, reaction } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; -import { Flip } from 'react-awesome-reveal'; import { FaBug } from 'react-icons/fa'; -import { returnEmptyFilter, returnFalse, returnTrue } from '../../../ClientUtils'; -import { Doc, DocListCast, Opt, returnEmptyDoclist } from '../../../fields/Doc'; +import { ClientUtils, returnEmptyFilter, returnFalse, returnTrue } from '../../../ClientUtils'; +import { Doc, DocListCast, returnEmptyDoclist } from '../../../fields/Doc'; import { AclAdmin, DashVersion } from '../../../fields/DocSymbols'; import { StrCast } from '../../../fields/Types'; import { GetEffectiveAcl } from '../../../fields/util'; @@ -28,10 +27,6 @@ import { ObservableReactComponent } from '../ObservableReactComponent'; import { DefaultStyleProvider, returnEmptyDocViewList } from '../StyleProvider'; import './TopBar.scss'; import { OpenWhere } from '../nodes/OpenWhere'; -import { ChatBox } from '../nodes/chatbot/chatboxcomponents/ChatBox'; -import { FieldViewProps } from '../nodes/FieldView'; -import { FocusViewOptions } from '../nodes/FocusViewOptions'; -import { PinProps } from '../PinFuncs'; import { Docs } from '../../documents/Documents'; /** @@ -90,7 +85,7 @@ export class TopBar extends ObservableReactComponent<object> { {Doc.ActiveDashboard ? ( <IconButton onClick={this.navigateToHome} - icon={<FontAwesomeIcon icon={DocListCast(Doc.MySharedDocs.data_dashboards).some(dash => !DocListCast(Doc.MySharedDocs.viewed).includes(dash)) ? 'portrait' : 'home'} />} + icon={<FontAwesomeIcon icon={DocListCast(Doc.MySharedDocs?.data_dashboards)?.some(dash => !DocListCast(Doc.MySharedDocs?.viewed)?.includes(dash)) ? 'portrait' : 'home'} />} color={this.color} background={this.backgroundColor} /> @@ -231,9 +226,11 @@ export class TopBar extends ObservableReactComponent<object> { val: 'tutorialagent', text: 'Ask AI!', onClick: () => { + const userEmail = ClientUtils.CurrentUserEmail(); + const userName = userEmail.split('@')[0]; const doc = Docs.Create.ChatDocument({ chat: 'Welcome to your help assistant for Dash. Ask any Dash-related questions to get started.', - title: 'Dash Documentation Assistant', + title: `${userName}'s Dash Help Assistant`, is_dash_doc_assistant: 'true', }); DocumentViewInternal.addDocTabFunc(doc, OpenWhere.addRight); |
