mirror of
https://github.com/wisplite/raster.git
synced 2026-05-01 06:32:44 -05:00
fix navbar and guest user checks
previously guest users would cause a response 500 if a private album existed, meaning they couldn't see any albums they also couldn't load media in any album due to requiring an access token
This commit is contained in:
@@ -7,7 +7,7 @@ export default function NavBar({ path }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const { user, logout } = useAccount();
|
||||
return (
|
||||
<div className="flex flex-row items-center justify-between h-1/10 w-full px-6 py-2 border-b border-[#2B2B2B]">
|
||||
<div className="flex flex-row items-center justify-between h-[10vh] w-full px-6 py-2 border-b border-[#2B2B2B] shrink-0">
|
||||
<div className="flex flex-row items-center justify-start gap-2">
|
||||
{path.map((item, index) => (
|
||||
<div className="flex flex-row items-center justify-start gap-2 red-hat-mono">
|
||||
|
||||
@@ -59,8 +59,11 @@ export const AccountProvider = ({ children }) => {
|
||||
if (!accessToken && localStorage.getItem('accessToken')) {
|
||||
setAccessToken(localStorage.getItem('accessToken'))
|
||||
return localStorage.getItem('accessToken')
|
||||
} else if (accessToken) {
|
||||
return accessToken
|
||||
} else {
|
||||
return "guest"
|
||||
}
|
||||
return accessToken
|
||||
}
|
||||
|
||||
return <AccountContext.Provider value={{ getAccessToken, logout, login, fetchUserData, user }}>{children}</AccountContext.Provider>
|
||||
|
||||
@@ -51,7 +51,7 @@ export default function Gallery() {
|
||||
}, [currentAlbumID])
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-start h-full w-full bg-[#141414]">
|
||||
<div className="flex flex-col items-center justify-start min-h-screen w-full bg-[#141414]">
|
||||
<NavBar path={pathList} />
|
||||
<AlbumList currentAlbumName={currentAlbumID} />
|
||||
<MediaList albumId={currentAlbumID} albumName={currentAlbumName} />
|
||||
|
||||
Reference in New Issue
Block a user