Improve how verified task statuses are displayed and remembered

Update the task management page to load and display previously verified task states from cache, ensuring the verification status persists across page reloads and user interactions.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/uMhb9Na
This commit is contained in:
michaelschal committed 2025-09-08 19:46:47 +00:00
1 parent 9ad6434c55
commit 4c3b355659
1 file changed
+23 -1
+23 -1
View File
@@ -130,6 +130,28 @@ export default function Avoirs() {
const { toast } = useToast();
const queryClient = useQueryClient();
// 🔄 Charger les vérifications du cache au démarrage
useEffect(() => {
const loadCachedVerifications = async () => {
if (!avoirs) return;
const cachedResults: Record<number, any> = {};
for (const avoir of avoirs) {
if (avoir.invoiceReference?.trim() && avoir.nocodbVerified) {
// Si l'avoir est validé, marquer comme vérifié
cachedResults[avoir.id] = { exists: true, fromCache: true, permanent: true };
}
}
if (Object.keys(cachedResults).length > 0) {
setAvoirVerificationResults(prev => ({ ...prev, ...cachedResults }));
console.log('✅ Vérifications cachées chargées:', cachedResults);
}
};
loadCachedVerifications();
}, [avoirs]);
// Fetch user profile
const { data: user } = useQuery({
queryKey: ['/api/user'],
@@ -1111,7 +1133,7 @@ export default function Avoirs() {
<div className="flex items-center justify-center">
{verifyingAvoirs.has(avoir.id) ? (
<Clock className="h-4 w-4 text-blue-500 animate-spin" />
) : avoirVerificationResults[avoir.id]?.exists === true ? (
) : (avoirVerificationResults[avoir.id]?.exists === true || avoir.nocodbVerified) ? (
<CheckCircle className="h-4 w-4 text-green-500 cursor-help" />
) : avoirVerificationResults[avoir.id]?.exists === false ? (
<XCircle className="h-4 w-4 text-red-500 cursor-help" />