);
}
-export default connect(null, mapDispatchToProps)(ChatOpenButton);
+export default connect(mapStateToProps, mapDispatchToProps)(ChatOpenButton);
diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx
index 03d2689fa..e47695139 100644
--- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx
+++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx
@@ -84,55 +84,59 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
-
-
-
-
- {job.ownr_ph1 || ""}
-
-
- {`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${
- job.ownr_city || ""
- } ${job.ownr_st || ""} ${job.ownr_zip || ""}`}
-
-
- {job.ownr_ea || ""}
-
-
-
-
-
-
-
+ {`${job.ownr_fn || ""} ${job.ownr_ln || ""} ${
+ job.ownr_co_nm || ""
+ }`}
+
}
>
-
+
+
+
+
+ {`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${
+ job.ownr_city || ""
+ } ${job.ownr_st || ""} ${job.ownr_zip || ""}`}
+
+
+ {job.ownr_ea || ""}
+
+
+
+
+
+
+ {`${job.v_model_yr || ""} ${job.v_color || ""}
${job.v_make_desc || ""}
${job.v_model_desc || ""}`}
- >
-
-
- {`${job.plate_no || t("general.labels.na")} (${`${
- job.plate_st || t("general.labels.na")
- }`})`}
-
-
- {`${job.v_vin || t("general.labels.na")}`}
-
-
-
-
+
+ }
+ >
+
+
+ {`${job.plate_no || t("general.labels.na")} (${`${
+ job.plate_st || t("general.labels.na")
+ }`})`}
+
+
+ {`${job.v_vin || t("general.labels.na")}`}
+
+
+
(
-
+
),
},
diff --git a/client/src/graphql/conversations.queries.js b/client/src/graphql/conversations.queries.js
index 8f294f811..f18b43eca 100644
--- a/client/src/graphql/conversations.queries.js
+++ b/client/src/graphql/conversations.queries.js
@@ -70,6 +70,10 @@ export const CONVERSATION_ID_BY_PHONE = gql`
query CONVERSATION_ID_BY_PHONE($phone: String!) {
conversations(where: { phone_num: { _eq: $phone } }) {
id
+ job_conversations {
+ jobid
+ id
+ }
}
}
`;
diff --git a/client/src/redux/messaging/messaging.sagas.js b/client/src/redux/messaging/messaging.sagas.js
index c96a30942..296dca198 100644
--- a/client/src/redux/messaging/messaging.sagas.js
+++ b/client/src/redux/messaging/messaging.sagas.js
@@ -4,7 +4,7 @@ import { all, call, put, select, takeLatest } from "redux-saga/effects";
import { logImEXEvent } from "../../firebase/firebase.utils";
import {
CONVERSATION_ID_BY_PHONE,
- CREATE_CONVERSATION
+ CREATE_CONVERSATION,
} from "../../graphql/conversations.queries";
import { INSERT_CONVERSATION_TAG } from "../../graphql/job-conversations.queries";
import client from "../../utils/GraphQLClient";
@@ -12,7 +12,7 @@ import { selectBodyshop } from "../user/user.selectors";
import {
sendMessageFailure,
sendMessageSuccess,
- setSelectedConversation
+ setSelectedConversation,
} from "./messaging.actions";
import MessagingActionTypes from "./messaging.types";
@@ -64,7 +64,9 @@ export function* openChatByPhone({ payload }) {
} else if (conversations.length === 1) {
//got the ID. Open it.
yield put(setSelectedConversation(conversations[0].id));
- if (jobid)
+
+ //Check to see if this job ID is already a child of it. If not add the tag.
+ if (!conversations[0].job_conversations.find((jc) => jc.jobid === jobid))
yield client.mutate({
mutation: INSERT_CONVERSATION_TAG,
variables: {