Skip to content

Commit

Permalink
bugfix: logout flow (#146)
Browse files Browse the repository at this point in the history
* logout flow error fixed #144

* style: pretty code

by ci

---------

Co-authored-by: techyNonso <techyNonso@users.noreply.github.com>
  • Loading branch information
codypharm and techyNonso authored Nov 13, 2023
1 parent 3ea1955 commit 81e7be3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/dashboard/dashLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Image from 'next/image'
import React, { useState } from 'react'
// import { useRouter } from '';
import { redirect, usePathname } from 'next/navigation'
import { usePathname } from 'next/navigation'
import imageDecenterLogoWhite from '@public/Logo White.png'
import imageDecenterLogoSubtitle from '@public/Logo Texts.png'
import { RxDashboard } from 'react-icons/rx'
Expand All @@ -24,7 +24,7 @@ import { useRouter } from 'next/navigation'
export const DashLayout = ({ children }: { children: React.ReactNode }) => {
const { user } = useUserStore()
const pathname = usePathname()

const { push, replace } = useRouter()
const [isNotificationOpen, setNotificationOpen] = useState(false)
const [showBackdrop, setShowBackdrop] = useState(false)
const [isProfileOpen, setProfileOpen] = useState(false)
Expand All @@ -46,7 +46,7 @@ export const DashLayout = ({ children }: { children: React.ReactNode }) => {
console.log('logout')
localStorage.clear()
userStore.clearUser()
redirect('/explore')
replace('/explore')
// push('/explore')
}

Expand Down Expand Up @@ -193,7 +193,7 @@ export const DashLayout = ({ children }: { children: React.ReactNode }) => {
</div>
) : (
<div className="bg-primary_11 text-primary_1 font-semibold font-primaryArchivo py-2 px-3 cursor-pointer rounded-xl relative">
<button className="flex flex-row" onClick={redirect('/explore')}>
<button className="flex flex-row" onClick={() => replace('/explore')}>
Log In
</button>
</div>
Expand Down

0 comments on commit 81e7be3

Please sign in to comment.