Seperated feedback flow for Inhouse and External agents
This commit is contained in:
@@ -34,7 +34,14 @@ const isUserSignedIn = () => {
|
||||
|
||||
const useFirestoreUpdates = () => {
|
||||
const {
|
||||
user: { user, isLoggedIn, sessionDetails, lock, selectedAgent = MY_CASE_ITEM },
|
||||
user: {
|
||||
user,
|
||||
isLoggedIn,
|
||||
sessionDetails,
|
||||
lock,
|
||||
selectedAgent = MY_CASE_ITEM,
|
||||
isExternalAgent = false,
|
||||
},
|
||||
allCases: { caseDetails, casesList },
|
||||
} = useAppSelector((state: RootState) => ({
|
||||
user: state.user || {},
|
||||
@@ -42,6 +49,7 @@ const useFirestoreUpdates = () => {
|
||||
}));
|
||||
const isTeamLead = useAppSelector((state) => state.user.isTeamLead);
|
||||
const lockRef = useRef<ILockData | null>(null);
|
||||
const isExternalAgentRef = useRef<boolean>(isExternalAgent);
|
||||
|
||||
useEffect(() => {
|
||||
lockRef.current = lock;
|
||||
@@ -211,7 +219,9 @@ const useFirestoreUpdates = () => {
|
||||
};
|
||||
|
||||
const subscribeToCollectionTemplate = () => {
|
||||
const collectionPath = 'template/external_template';
|
||||
const collectionPath = isExternalAgent
|
||||
? 'template/inhouse_template'
|
||||
: 'template/inhouse_template';
|
||||
return subscribeToDoc(handleCollectionTemplateUpdate, collectionPath);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user