File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ export default function MaintenancePage() {
1515 Under Maintenance
1616 </ h1 >
1717 < p className = "pt-2 text-lg text-gray-600 dark:text-gray-400" >
18- We' re currently performing scheduled maintenance to improve your
19- experience.
18+ We' re currently performing scheduled maintenance to improve
19+ your experience.
2020 </ p >
2121 </ div >
2222
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import React, {
66 useState ,
77 useEffect ,
88 useRef ,
9+ useCallback ,
910} from "react" ;
1011import { env } from "next-runtime-env" ;
1112import { config } from "@/lib/config" ;
@@ -33,7 +34,7 @@ export function SettingsProvider({ children }: { children: React.ReactNode }) {
3334 const hasFetchedRef = useRef ( false ) ;
3435 const lastAdminStatusRef = useRef < boolean | undefined > ( undefined ) ;
3536
36- const fetchSettings = async ( ) => {
37+ const fetchSettings = useCallback ( async ( ) => {
3738 try {
3839 const endpoint = user ?. is_admin
3940 ? `${ config . apiBaseUrl } /api/admin/v1/settings`
@@ -61,7 +62,7 @@ export function SettingsProvider({ children }: { children: React.ReactNode }) {
6162 } finally {
6263 setLoading ( false ) ;
6364 }
64- } ;
65+ } , [ user ?. is_admin ] ) ;
6566
6667 useEffect ( ( ) => {
6768 const isAdmin = user ?. is_admin ;
@@ -74,7 +75,7 @@ export function SettingsProvider({ children }: { children: React.ReactNode }) {
7475 lastAdminStatusRef . current = isAdmin ;
7576 fetchSettings ( ) ;
7677 }
77- } , [ user ?. is_admin ] ) ;
78+ } , [ user ?. is_admin , fetchSettings ] ) ;
7879
7980 useEffect ( ( ) => {
8081 const handleSettingsUpdate = async ( ) => {
You can’t perform that action at this time.
0 commit comments