diff --git a/context/AuthContext.tsx b/context/AuthContext.tsx
index 1222b4b..4a5a41f 100644
--- a/context/AuthContext.tsx
+++ b/context/AuthContext.tsx
@@ -18,14 +18,18 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => {
useEffect(() => {
if (getCookie('token')) {
- const getUser = async () => {
- await axios.get('/details').then((response) => {
- setIsAuthenticated(true)
- setCurrentUser(response.data.user)
- })
+ try {
+ const getUser = async () => {
+ await axios.get('/details').then((response) => {
+ setIsAuthenticated(true)
+ setCurrentUser(response.data.user)
+ })
+ }
+ getUser()
+ } catch (error) {
+ // eslint-disable-next-line no-console
+ console.log({ error })
}
-
- getUser()
}
}, [])
diff --git a/context/ThemeContext.tsx b/context/ThemeContext.tsx
index 7e874ef..d8095ec 100644
--- a/context/ThemeContext.tsx
+++ b/context/ThemeContext.tsx
@@ -15,7 +15,7 @@ const THEME_NAME = 'droidcon_theme'
export const ThemeProvider = ({ children }: { children: ReactNode }) => {
const [isDarkTheme, setIsDarkTheme] = useState(false)
- const isEventReady = false // Boolean(process.env.NEXT_PUBLIC_EVENT_READY) || false
+ const isEventReady = Boolean(process.env.NEXT_PUBLIC_EVENT_READY) || false
useEffect(() => {
if (isClient) {
diff --git a/next.config.js b/next.config.js
index ad4e78c..47b69be 100755
--- a/next.config.js
+++ b/next.config.js
@@ -47,6 +47,19 @@ module.exports = withPWA({
// method: 'GET',
// strategyOptions: { cacheableResponse: { statuses: [0, 200] } },
},
+ {
+ urlPattern: '/^https://res.cloudinary.com/droidconke/*/i',
+ handler: 'CacheFirst',
+ options: {
+ cacheName: 'static-image-assets-1',
+ expiration: {
+ maxEntries: 4,
+ maxAgeSeconds: 7 * 24 * 60 * 60, // 7 days
+ },
+ },
+ // method: 'GET',
+ // strategyOptions: { cacheableResponse: { statuses: [0, 200] } },
+ },
{
urlPattern: '/^https://sessionize.com/image*/i',
handler: 'CacheFirst',
diff --git a/pages/sessions/index.tsx b/pages/sessions/index.tsx
index 94b258d..612c744 100644
--- a/pages/sessions/index.tsx
+++ b/pages/sessions/index.tsx
@@ -57,10 +57,7 @@ const Sessions: NextPage
= ({
{!loading ? (
-
+
{Object.keys(schedules)?.map((key, i) => {
return (