Fix Layout bug

This commit is contained in:
Justin Edmund 2023-01-25 23:25:30 -08:00
parent c75e5052ad
commit 0b59f529c7

View file

@ -26,11 +26,17 @@ const Layout = ({ children }: PropsWithChildren<Props>) => {
}, []) }, [])
function getToastCookie() { function getToastCookie() {
const updatedAt = new Date(appState.version.updated_at) if (appState.version.updated_at !== '') {
const cookieValues = getCookie(`update-${format(updatedAt, 'yyyy-MM-dd')}`) const updatedAt = new Date(appState.version.updated_at)
return cookieValues const cookieValues = getCookie(
? (JSON.parse(cookieValues as string) as { seen: true }) `update-${format(updatedAt, 'yyyy-MM-dd')}`
: { seen: false } )
return cookieValues
? (JSON.parse(cookieValues as string) as { seen: true })
: { seen: false }
} else {
return { seen: false }
}
} }
function handleToastActionClicked() { function handleToastActionClicked() {