Skip to content

Commit

Permalink
Hide assistant messages (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagodarybacka committed Dec 14, 2023
2 parents ae479e9 + fe9a324 commit 1218aac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/shared/hooks/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export function useAssistant(): {

useEffect(() => {
if (!assistantState) {
if (!isStakedInRealm) {
updateAssistantState({ visible: true, type: "welcome" })
} else {
updateAssistantState({ visible: false, type: "default" })
}
// if (!isStakedInRealm) {
// updateAssistantState({ visible: true, type: "welcome" })
// } else {
updateAssistantState({ visible: false, type: "default" })
// }
}
}, [assistantState, updateAssistantState, isStakedInRealm])

Expand Down
14 changes: 7 additions & 7 deletions src/shared/hooks/realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
REALM_PANEL_ANIMATION_TIME,
} from "shared/constants"
import { useLocalStorageChange, useTabletScreen } from "./helpers"
import { useAssistant } from "./assistant"
// import { useAssistant } from "./assistant"

export function useRealmPanelTransition(position: "left" | "right") {
const realmPanelVisible = useDappSelector(selectRealmPanelVisible)
Expand Down Expand Up @@ -103,7 +103,7 @@ export function usePanelRealmClose() {
export function useOnRealmClick() {
const realmId = useDappSelector(selectDisplayedRealmId)
const dispatch = useDappDispatch()
const { updateAssistant, assistantVisible } = useAssistant()
// const { updateAssistant, assistantVisible } = useAssistant()

const { value: visitedRealm, updateStorage: updateVisitedRealm } =
useLocalStorageChange<boolean>(LOCAL_STORAGE_VISITED_REALM)
Expand All @@ -114,20 +114,20 @@ export function useOnRealmClick() {
dispatch(setDisplayedRealmId(String(id)))
dispatch(setRealmPanelVisible(true))

if (assistantVisible("welcome"))
updateAssistant({ visible: false, type: "default" })
// if (assistantVisible("welcome"))
// updateAssistant({ visible: false, type: "default" })

if (!visitedRealm) {
updateVisitedRealm(true)
updateAssistant({ visible: true, type: "first-realm" })
// updateAssistant({ visible: true, type: "first-realm" })
}
}
},
[
assistantVisible,
// assistantVisible,
dispatch,
realmId,
updateAssistant,
// updateAssistant,
updateVisitedRealm,
visitedRealm,
]
Expand Down
12 changes: 6 additions & 6 deletions src/ui/Assistant/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import Icon from "shared/components/Media/Icon"
import assistantImage from "shared/assets/assistant.png"
import Portal from "shared/components/Interface/Portal"
import { useAssistant } from "shared/hooks"
import AssistantWelcome from "./AssistantContent/AssistantWelcome"
import AssistantChallenges from "./AssistantContent/AssistantChallenges"
// import AssistantWelcome from "./AssistantContent/AssistantWelcome"
// import AssistantChallenges from "./AssistantContent/AssistantChallenges"
import AssistantJoin from "./AssistantContent/AssistantJoin"
import AssistantFirstRealm from "./AssistantContent/AssistantFirstRealm"
// import AssistantFirstRealm from "./AssistantContent/AssistantFirstRealm"

export default function Assistant() {
const { assistant, updateAssistant } = useAssistant()
Expand All @@ -32,10 +32,10 @@ export default function Assistant() {
}
/>
</div>
<AssistantWelcome />
<AssistantChallenges />
{/* <AssistantWelcome /> */}
{/* <AssistantChallenges /> */}
<AssistantJoin />
<AssistantFirstRealm />
{/* <AssistantFirstRealm /> */}
</div>
</Portal>
<style jsx>{`
Expand Down

0 comments on commit 1218aac

Please sign in to comment.