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:
@@ -191,6 +191,7 @@ export default function ImportSettings() {
|
||||
onClick={async () => {
|
||||
try {
|
||||
await stopFolderServiceMutation.mutateAsync();
|
||||
await utils.folderImportService.status.invalidate();
|
||||
toast.success("Service arrêté", {
|
||||
description: "L'import automatique depuis dossier a été arrêté.",
|
||||
});
|
||||
@@ -212,13 +213,14 @@ export default function ImportSettings() {
|
||||
) : (
|
||||
<Button
|
||||
onClick={async () => {
|
||||
try {
|
||||
const result = await startFolderServiceMutation.mutateAsync();
|
||||
if (result.success) {
|
||||
toast.success("Service démarré", {
|
||||
description: "L'import automatique depuis dossier est maintenant actif.",
|
||||
});
|
||||
} else {
|
||||
try {
|
||||
const result = await startFolderServiceMutation.mutateAsync();
|
||||
if (result.success) {
|
||||
await utils.folderImportService.status.invalidate();
|
||||
toast.success("Service démarré", {
|
||||
description: "L'import automatique depuis dossier est maintenant actif.",
|
||||
});
|
||||
} else {
|
||||
toast.error("Erreur", {
|
||||
description: "Impossible de démarrer le service. Vérifiez la configuration.",
|
||||
});
|
||||
@@ -361,6 +363,7 @@ export default function ImportSettings() {
|
||||
onClick={async () => {
|
||||
try {
|
||||
await stopEmailServiceMutation.mutateAsync();
|
||||
await utils.emailImportService.status.invalidate();
|
||||
toast.success("Service arrêté", {
|
||||
description: "L'import automatique par email a été arrêté.",
|
||||
});
|
||||
@@ -385,6 +388,7 @@ export default function ImportSettings() {
|
||||
try {
|
||||
const result = await startEmailServiceMutation.mutateAsync();
|
||||
if (result.success) {
|
||||
await utils.emailImportService.status.invalidate();
|
||||
toast.success("Service démarré", {
|
||||
description: "L'import automatique par email est maintenant actif.",
|
||||
});
|
||||
@@ -421,13 +425,13 @@ export default function ImportSettings() {
|
||||
variant="outline"
|
||||
onClick={async () => {
|
||||
try {
|
||||
toast.info("V\u00e9rification en cours...", {
|
||||
toast.info("Vérification en cours...", {
|
||||
description: "Connexion au serveur IMAP et recherche de nouveaux emails.",
|
||||
});
|
||||
const result = await checkNowEmailMutation.mutateAsync();
|
||||
if (result.success) {
|
||||
await utils.importLogs.getByUser.invalidate();
|
||||
toast.success("V\u00e9rification termin\u00e9e", {
|
||||
toast.success("Vérification terminée", {
|
||||
description: result.message,
|
||||
});
|
||||
} else {
|
||||
@@ -437,7 +441,7 @@ export default function ImportSettings() {
|
||||
}
|
||||
} catch (error: any) {
|
||||
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" />
|
||||
)}
|
||||
V\u00e9rifier maintenant
|
||||
Vérifier maintenant
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user