Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/ConnectionAndEvaluationStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const ConnectionAndEvaluationStatus = ({
myConnectionToSubject: inboundConnectionInfo,
myConfidenceValueInThisSubjectRating: confidenceValue,
} = useMyEvaluationsContext({ subjectId });

const authData = useSelector(selectAuthData);

const impactPercentage = useImpactPercentage(auraImpacts, authData?.brightId);
Expand Down
4 changes: 4 additions & 0 deletions src/components/EvaluationFlow/EvaluationFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { useCallback, useEffect, useState } from 'react';
import useViewMode from '../../hooks/useViewMode';
import { EvaluationCategory, PreferredView } from '../../types/dashboard';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/dialog';
import { useDispatch } from '@/store/hooks';
import { connectionsApi } from '@/store/api/connections';
import { profileApi } from '@/store/api/profile';

const EvaluationFlow = ({
showEvaluationFlow,
Expand Down Expand Up @@ -40,6 +43,7 @@ const EvaluationFlow = ({
const onSubmitted = useCallback(
async (newRating: number | null | undefined) => {
const myRatingsCount = myRatings?.filter((r) => Number(r.rating)).length;

refreshInboundRatings();
refreshOutboundRatings();
if (!newRating) {
Expand Down
11 changes: 9 additions & 2 deletions src/components/EvaluationOpNotifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import {
} from '../constants';
import { useRefreshEvaluationsContext } from '../contexts/RefreshEvaluationsContext';
import { useSubjectName } from '../hooks/useSubjectName';
import { useSelector } from '../store/hooks';
import { useDispatch, useSelector } from '../store/hooks';
import BrightIdProfilePicture from './BrightIdProfilePicture';
import EvaluationThumb from './Shared/EvaluationThumb';
import { connectionsApi } from '@/store/api/connections';
import { profileApi } from '@/store/api/profile';

type EvaluateOpNotificationData = {
text: string;
Expand Down Expand Up @@ -106,6 +108,7 @@ export default function EvaluationOpNotifications() {
const operations = useSelector(selectEvaluateOperations);

const prevOperationsRef = useRef<EvaluateSubmittedOperation[] | null>(null);
const dispatch = useDispatch();

useEffect(() => {
const storedOperations = localStorage.getItem('prevOperations');
Expand Down Expand Up @@ -166,6 +169,10 @@ export default function EvaluationOpNotifications() {
prevOperation.state !== operation_states.APPLIED &&
operation.state === operation_states.APPLIED
) {
dispatch(connectionsApi.util.invalidateTags([{ type: 'BrightID' }]));

dispatch(profileApi.util.invalidateTags([{ type: 'BrightID' }]));

addNotification({
operation,
text: `Applied!`,
Expand All @@ -186,7 +193,7 @@ export default function EvaluationOpNotifications() {
// Update ref and localStorage with the latest operations
prevOperationsRef.current = operations;
localStorage.setItem('prevOperations', JSON.stringify(operations));
}, [addNotification, operations, refreshEvaluations]);
}, [addNotification, operations, refreshEvaluations, dispatch]);

return (
<div className="w-full">
Expand Down
Loading