fix: Redirect after contact delete [CW-2397] (#7740)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com> Co-authored-by: Shivam Mishra <scm.mymail@gmail.com> Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -49,3 +49,38 @@ export const validateLoggedInRoutes = (to, user, roleWiseRoutes) => {
|
||||
// Proceed to the route if none of the above conditions are met
|
||||
return null;
|
||||
};
|
||||
|
||||
export const isAConversationRoute = routeName =>
|
||||
[
|
||||
'inbox_conversation',
|
||||
'conversation_through_mentions',
|
||||
'conversation_through_unattended',
|
||||
'conversation_through_inbox',
|
||||
'conversations_through_label',
|
||||
'conversations_through_team',
|
||||
'conversations_through_folders',
|
||||
'conversation_through_participating',
|
||||
].includes(routeName);
|
||||
|
||||
export const getConversationDashboardRoute = routeName => {
|
||||
switch (routeName) {
|
||||
case 'inbox_conversation':
|
||||
return 'home';
|
||||
case 'conversation_through_mentions':
|
||||
return 'conversation_mentions';
|
||||
case 'conversation_through_unattended':
|
||||
return 'conversation_unattended';
|
||||
case 'conversations_through_label':
|
||||
return 'label_conversations';
|
||||
case 'conversations_through_team':
|
||||
return 'team_conversations';
|
||||
case 'conversations_through_folders':
|
||||
return 'folder_conversations';
|
||||
case 'conversation_through_participating':
|
||||
return 'conversation_participating';
|
||||
case 'conversation_through_inbox':
|
||||
return 'inbox_dashboard';
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user