Skip to content

Commit

Permalink
fix(apps/frontend-pwa): hide survey notification on mobile and resolv…
Browse files Browse the repository at this point in the history
…e state loading issue (#4125)
  • Loading branch information
sjschlapbach committed May 15, 2024
1 parent 9cf83ca commit 8c1e6f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 3 additions & 5 deletions apps/frontend-pwa/src/components/common/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ function Header({
const { pathname, asPath, query } = router
const t = useTranslations()

const { value: hasSeenSurvey, setValue: setHasSeenSurvey } = useStickyState(
'hasSeenSurvey',
'false'
)
const { stickyValue: hasSeenSurvey, setValue: setHasSeenSurvey } =
useStickyState('hasSeenSurvey', 'false')

const [changeParticipantLocale] = useMutation(ChangeParticipantLocaleDocument)

Expand Down Expand Up @@ -91,7 +89,7 @@ function Header({
>
<Button
className={{
root: 'text-white flex flex-row gap-2 items-center bg-uzh-red-100 border-uzh-red-100 rounded px-2 -mx-2',
root: 'hidden md:flex text-white flex-row gap-2 items-center bg-uzh-red-100 border-uzh-red-100 rounded px-2 -mx-2',
}}
onClick={() => {
setHasSeenSurvey(true)
Expand Down
6 changes: 2 additions & 4 deletions apps/frontend-pwa/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ const Index = function () {
const router = useRouter()
const t = useTranslations()

const { value: hasSeenSurvey, setValue: setHasSeenSurvey } = useStickyState(
'hasSeenSurvey',
'false'
)
const { stickyValue: hasSeenSurvey, setValue: setHasSeenSurvey } =
useStickyState('hasSeenSurvey', 'false')

const [subscribeToPush] = useMutation(SubscribeToPushDocument)
const [unsubscribeFromPush] = useMutation(UnsubscribeFromPushDocument)
Expand Down

0 comments on commit 8c1e6f0

Please sign in to comment.