Checkpoint: Correction de l'encodage Unicode du bouton "Vérifier maintenant" et ajout du rafraîchissement automatique de l'interface après démarrage/arrêt des services d'import.

This commit is contained in:
Manus
2026-02-11 06:02:34 -05:00
parent 2715c9e0c7
commit 280abba902
2 changed files with 19 additions and 11 deletions

View File

@@ -191,6 +191,7 @@ export default function ImportSettings() {
onClick={async () => { onClick={async () => {
try { try {
await stopFolderServiceMutation.mutateAsync(); await stopFolderServiceMutation.mutateAsync();
await utils.folderImportService.status.invalidate();
toast.success("Service arrêté", { toast.success("Service arrêté", {
description: "L'import automatique depuis dossier a é arrêté.", description: "L'import automatique depuis dossier a é arrêté.",
}); });
@@ -215,6 +216,7 @@ export default function ImportSettings() {
try { try {
const result = await startFolderServiceMutation.mutateAsync(); const result = await startFolderServiceMutation.mutateAsync();
if (result.success) { if (result.success) {
await utils.folderImportService.status.invalidate();
toast.success("Service démarré", { toast.success("Service démarré", {
description: "L'import automatique depuis dossier est maintenant actif.", description: "L'import automatique depuis dossier est maintenant actif.",
}); });
@@ -361,6 +363,7 @@ export default function ImportSettings() {
onClick={async () => { onClick={async () => {
try { try {
await stopEmailServiceMutation.mutateAsync(); await stopEmailServiceMutation.mutateAsync();
await utils.emailImportService.status.invalidate();
toast.success("Service arrêté", { toast.success("Service arrêté", {
description: "L'import automatique par email a été arrêté.", description: "L'import automatique par email a été arrêté.",
}); });
@@ -385,6 +388,7 @@ export default function ImportSettings() {
try { try {
const result = await startEmailServiceMutation.mutateAsync(); const result = await startEmailServiceMutation.mutateAsync();
if (result.success) { if (result.success) {
await utils.emailImportService.status.invalidate();
toast.success("Service démarré", { toast.success("Service démarré", {
description: "L'import automatique par email est maintenant actif.", description: "L'import automatique par email est maintenant actif.",
}); });
@@ -421,13 +425,13 @@ export default function ImportSettings() {
variant="outline" variant="outline"
onClick={async () => { onClick={async () => {
try { try {
toast.info("V\u00e9rification en cours...", { toast.info("Vérification en cours...", {
description: "Connexion au serveur IMAP et recherche de nouveaux emails.", description: "Connexion au serveur IMAP et recherche de nouveaux emails.",
}); });
const result = await checkNowEmailMutation.mutateAsync(); const result = await checkNowEmailMutation.mutateAsync();
if (result.success) { if (result.success) {
await utils.importLogs.getByUser.invalidate(); await utils.importLogs.getByUser.invalidate();
toast.success("V\u00e9rification termin\u00e9e", { toast.success("Vérification terminée", {
description: result.message, description: result.message,
}); });
} else { } else {
@@ -437,7 +441,7 @@ export default function ImportSettings() {
} }
} catch (error: any) { } catch (error: any) {
toast.error("Erreur", { toast.error("Erreur", {
description: error.message || "Impossible de v\u00e9rifier les emails.", description: error.message || "Impossible de vérifier les emails.",
}); });
} }
}} }}
@@ -448,7 +452,7 @@ export default function ImportSettings() {
) : ( ) : (
<Mail className="mr-2 h-4 w-4" /> <Mail className="mr-2 h-4 w-4" />
)} )}
V\u00e9rifier maintenant Vérifier maintenant
</Button> </Button>
)} )}
</div> </div>

View File

@@ -191,3 +191,7 @@
- [x] Ajouter fonction triggerEmailCheck dans emailImportService - [x] Ajouter fonction triggerEmailCheck dans emailImportService
- [x] Ajouter route tRPC emailImportService.checkNow - [x] Ajouter route tRPC emailImportService.checkNow
- [ ] Tester avec un email réel et diagnostiquer les erreurs IMAP - [ ] Tester avec un email réel et diagnostiquer les erreurs IMAP
## Bugs interface ImportSettings
- [x] Corriger l'encodage Unicode du bouton "Vérifier maintenant"
- [x] Ajouter rafraîchissement automatique du statut du service après démarrage/arrêt (email et dossier)