+
conversation", conversation);
const { t } = useTranslation();
const [visible, setVisible] = useState(false);
const searchQueryState = useState("");
diff --git a/client/src/redux/messaging/messaging.actions.js b/client/src/redux/messaging/messaging.actions.js
index 25ef4ab97..77bb569c7 100644
--- a/client/src/redux/messaging/messaging.actions.js
+++ b/client/src/redux/messaging/messaging.actions.js
@@ -23,3 +23,8 @@ export const setSelectedConversation = (conversationId) => ({
type: MessagingActionTypes.SET_SELECTED_CONVERSATION,
payload: conversationId,
});
+
+export const openChatByPhone = (phoneNumber) => ({
+ type: MessagingActionTypes.OPEN_CHAT_BY_PHONE,
+ payload: phoneNumber,
+});
\ No newline at end of file
diff --git a/client/src/redux/messaging/messaging.sagas.js b/client/src/redux/messaging/messaging.sagas.js
index f167b42f6..a181518d0 100644
--- a/client/src/redux/messaging/messaging.sagas.js
+++ b/client/src/redux/messaging/messaging.sagas.js
@@ -3,7 +3,14 @@ import { sendMessageFailure, sendMessageSuccess } from "./messaging.actions";
import MessagingActionTypes from "./messaging.types";
import axios from "axios";
import { sendEmailFailure } from "../email/email.actions";
+import { withApollo } from "react-apollo";
+export function* onOpenChatByPhone() {
+ yield takeLatest(MessagingActionTypes.OPEN_CHAT_BY_PHONE, openChatByPhone);
+}
+export function* openChatByPhone({ payload: phone, client }) {
+ console.log("Payload: Phone, Client", phone, client);
+}
export function* onSendMessage() {
yield takeLatest(MessagingActionTypes.SEND_MESSAGE, sendMessage);
}
@@ -22,5 +29,5 @@ export function* sendMessage({ payload }) {
}
export function* messagingSagas() {
- yield all([call(onSendMessage)]);
+ yield all([call(onSendMessage), call(onOpenChatByPhone)]);
}
diff --git a/client/src/redux/messaging/messaging.types.js b/client/src/redux/messaging/messaging.types.js
index c6c3caf16..a620ef027 100644
--- a/client/src/redux/messaging/messaging.types.js
+++ b/client/src/redux/messaging/messaging.types.js
@@ -3,6 +3,7 @@ const MessagingActionTypes = {
SEND_MESSAGE: "SEND_MESSAGE",
SEND_MESSAGE_SUCCESS: "SEND_MESSAGE_SUCCESS",
SEND_MESSAGE_FAILURE: "SEND_MESSAGE_FAILURE",
- SET_SELECTED_CONVERSATION: 'SET_SELECTED_CONVERSATION'
+ SET_SELECTED_CONVERSATION: "SET_SELECTED_CONVERSATION",
+ OPEN_CHAT_BY_PHONE: "OPEN_CHAT_BY_PHONE",
};
export default MessagingActionTypes;
diff --git a/client/src/serviceWorker.js b/client/src/serviceWorker.js
index e247dde35..85bd9079b 100644
--- a/client/src/serviceWorker.js
+++ b/client/src/serviceWorker.js
@@ -55,7 +55,7 @@ export function register(config) {
if ("serviceWorker" in navigator) {
navigator.serviceWorker
- .register("./firebase-messaging-sw.js")
+ .register("/firebase-messaging-sw.js")
.then(function (registration) {
console.log(
"FCM Registration successful, scope is:",