Display message in UI before reloading

This commit is contained in:
Adw8 2025-01-30 12:30:36 +05:30
parent de0b4d42c2
commit cc64e6a035
2 changed files with 5 additions and 4 deletions

View File

@ -60,7 +60,10 @@ const AIServiceCard: React.FC<AIServiceCardProps> = ({
loading: false,
error: result.error,
})
return
// Reload the page to get latest prices
setTimeout(() => {
window.location.reload();
}, 3000);
}
if (result.imageUrl) {
@ -121,7 +124,7 @@ const AIServiceCard: React.FC<AIServiceCardProps> = ({
{generationState.error && (
<div className="mt-4 bg-red-900/20 border border-red-500/20 text-red-400 px-4 py-3 rounded-xl text-center">
{generationState.error}
{generationState.error}, reloading...
</div>
)}

View File

@ -65,8 +65,6 @@ export async function generateWithFlux(
}
} catch (error) {
console.error('Flux generation error:', error)
// Reload the page to get latest prices
window.location.reload();
return {
error: error instanceof Error ? error.message : 'Generation failed'
}