File tree Expand file tree Collapse file tree 3 files changed +26
-18
lines changed
Expand file tree Collapse file tree 3 files changed +26
-18
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ const nextConfig = {
1414 ] ,
1515 } ,
1616
17+ env : {
18+ NEXT_PUBLIC_BUILD_TIME : Date . now ( ) ,
19+ } ,
20+
1721 output : "export" ,
1822 basePath : "/ProxmoxVE" ,
1923} ;
Original file line number Diff line number Diff line change @@ -47,13 +47,15 @@ function ScriptContent() {
4747 } ;
4848
4949 useEffect ( ( ) => {
50- fetch ( "api/categories" )
51- . then ( ( response ) => response . json ( ) )
52- . then ( ( categories ) => {
53- const sortedCategories = sortCategories ( categories ) ;
54- setLinks ( sortedCategories ) ;
55- } )
56- . catch ( ( error ) => console . error ( error ) ) ;
50+ fetch (
51+ `/api/categories?_=${ process . env . NEXT_PUBLIC_BUILD_TIME || Date . now ( ) } ` ,
52+ )
53+ . then ( ( response ) => response . json ( ) )
54+ . then ( ( categories ) => {
55+ const sortedCategories = sortCategories ( categories ) ;
56+ setLinks ( sortedCategories ) ;
57+ } )
58+ . catch ( ( error ) => console . error ( error ) ) ;
5759 } , [ ] ) ;
5860
5961 return (
Original file line number Diff line number Diff line change @@ -52,17 +52,19 @@ export default function CommandMenu() {
5252
5353 const fetchCategories = async ( ) => {
5454 setIsLoading ( true ) ;
55- fetch ( "api/categories" )
56- . then ( ( response ) => response . json ( ) )
57- . then ( ( categories ) => {
58- const sortedCategories = sortCategories ( categories ) ;
59- setLinks ( sortedCategories ) ;
60- setIsLoading ( false ) ;
61- } )
62- . catch ( ( error ) => {
63- setIsLoading ( false ) ;
64- console . error ( error )
65- } ) ;
55+ fetch (
56+ `/api/categories?_=${ process . env . NEXT_PUBLIC_BUILD_TIME || Date . now ( ) } ` ,
57+ )
58+ . then ( ( response ) => response . json ( ) )
59+ . then ( ( categories ) => {
60+ const sortedCategories = sortCategories ( categories ) ;
61+ setLinks ( sortedCategories ) ;
62+ setIsLoading ( false ) ;
63+ } )
64+ . catch ( ( error ) => {
65+ setIsLoading ( false ) ;
66+ console . error ( error ) ;
67+ } ) ;
6668 } ;
6769
6870 return (
You can’t perform that action at this time.
0 commit comments