@@ -17,6 +17,7 @@ import { usePictoMutation } from '@/hooks/useQueryExtensio';
1717
1818import { useDispatch } from 'react-redux' ;
1919import { showLoader , hideLoader } from '@/features/loaderSlice' ;
20+ import { showInfoDialog } from '@/features/infoDialogSlice' ;
2021
2122import {
2223 deleteFolder ,
@@ -84,6 +85,16 @@ const Settings: React.FC = () => {
8485 const hasUpdate = await checkForUpdates ( ) ;
8586 if ( hasUpdate ) {
8687 setUpdateDialogOpen ( true ) ;
88+ } else {
89+ // Show info dialog when no updates are available
90+ dispatch (
91+ showInfoDialog ( {
92+ title : 'No Updates Available' ,
93+ message :
94+ 'Your application is already up to date with the latest version.' ,
95+ variant : 'info' ,
96+ } ) ,
97+ ) ;
8798 }
8899 dispatch ( hideLoader ( ) ) ;
89100 } ;
@@ -113,9 +124,23 @@ const Settings: React.FC = () => {
113124 const result = await deleteCache ( ) ;
114125 if ( result ) {
115126 console . log ( 'Cache deleted' ) ;
127+ dispatch (
128+ showInfoDialog ( {
129+ title : 'Cache Refreshed' ,
130+ message : 'The application cache has been successfully refreshed.' ,
131+ variant : 'info' ,
132+ } ) ,
133+ ) ;
116134 }
117135 } catch ( error ) {
118136 console . error ( 'Error deleting cache:' , error ) ;
137+ dispatch (
138+ showInfoDialog ( {
139+ title : 'Cache Refresh Error' ,
140+ message : 'Failed to refresh the application cache. Please try again.' ,
141+ variant : 'error' ,
142+ } ) ,
143+ ) ;
119144 }
120145 } ;
121146
@@ -134,10 +159,21 @@ const Settings: React.FC = () => {
134159 } ;
135160
136161 const showErrorDialog = ( title : string , err : unknown ) => {
162+ const errorMessage = err instanceof Error ? err . message : 'An unknown error occurred' ;
163+
164+ // Use the InfoDialog with error variant for consistent UI
165+ dispatch (
166+ showInfoDialog ( {
167+ title,
168+ message : errorMessage ,
169+ variant : 'error' ,
170+ } ) ,
171+ ) ;
172+
173+ // Also set the legacy error dialog content for backward compatibility
137174 setErrorDialogContent ( {
138175 title,
139- description :
140- err instanceof Error ? err . message : 'An unknown error occurred' ,
176+ description : errorMessage ,
141177 } ) ;
142178 } ;
143179
@@ -235,7 +271,6 @@ const Settings: React.FC = () => {
235271 </ p >
236272 </ div >
237273 </ div >
238-
239274 < ErrorDialog
240275 content = { errorDialogContent }
241276 onClose = { ( ) => setErrorDialogContent ( null ) }
0 commit comments