diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 3c2411d57..06913c288 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -29927,6 +29927,27 @@
+
+ nopush
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
phonenumber
false
diff --git a/client/public/firebase-messaging-sw.js b/client/public/firebase-messaging-sw.js
index 3bf458e19..7ee3f3d98 100644
--- a/client/public/firebase-messaging-sw.js
+++ b/client/public/firebase-messaging-sw.js
@@ -48,7 +48,6 @@ firebase.initializeApp(firebaseConfig);
const messaging = firebase.messaging();
messaging.onBackgroundMessage(function (payload) {
- console.log("FCM BG MSG", payload);
// Customize notification here
const channel = new BroadcastChannel("imex-sw-messages");
channel.postMessage(payload);
diff --git a/client/src/components/chat-affix/chat-affix.container.jsx b/client/src/components/chat-affix/chat-affix.container.jsx
index 02f7289ac..55fab18bd 100644
--- a/client/src/components/chat-affix/chat-affix.container.jsx
+++ b/client/src/components/chat-affix/chat-affix.container.jsx
@@ -46,11 +46,8 @@ export function ChatAffixContainer({ bodyshop, chatVisible }) {
toggleChatVisible()}
diff --git a/client/src/firebase/firebase.utils.js b/client/src/firebase/firebase.utils.js
index 19f4b6706..87f5189e7 100644
--- a/client/src/firebase/firebase.utils.js
+++ b/client/src/firebase/firebase.utils.js
@@ -38,8 +38,14 @@ export const updateCurrentPassword = async (password) => {
return updatePassword(currentUser, password);
};
+let messaging;
+try {
+ messaging = getMessaging();
+} catch (error) {
+ console.log(error);
+}
-export const messaging = getMessaging();
+export { messaging };
export const requestForToken = () => {
return getToken(messaging, {
@@ -48,6 +54,7 @@ export const requestForToken = () => {
.then((currentToken) => {
if (currentToken) {
console.log("current token for client: ", currentToken);
+ window.sessionStorage.setItem("fcmtoken", currentToken);
// Perform any other necessary action with the token
} else {
// Show permission request UI
diff --git a/client/src/pages/manage/manage.page.component.jsx b/client/src/pages/manage/manage.page.component.jsx
index 7e8571d23..836b73f6d 100644
--- a/client/src/pages/manage/manage.page.component.jsx
+++ b/client/src/pages/manage/manage.page.component.jsx
@@ -185,7 +185,11 @@ export function Manage({ match, conflict, bodyshop }) {
useEffect(() => {
const widgetId = "IABVNO4scRKY11XBQkNr";
window.noticeable.render("widget", widgetId);
- requestForToken();
+ try {
+ requestForToken();
+ } catch (error) {
+ console.log("Unable to request for token.", error);
+ }
}, []);
useEffect(() => {
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 533dc579d..316f315b2 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -1766,6 +1766,7 @@
"messaging": "Messaging",
"noallowtxt": "This customer has not indicated their permission to be messaged.",
"nojobs": "Not associated to any job.",
+ "nopush": "Polling Mode Enabled",
"phonenumber": "Phone #",
"presets": "Presets",
"recentonly": "Only your most recent 50 conversations will be shown here. If you are looking for an older conversation, find the related contact and click their phone number to view the conversation.",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index b29eea831..2c8dd2ddc 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -1766,6 +1766,7 @@
"messaging": "Mensajería",
"noallowtxt": "",
"nojobs": "",
+ "nopush": "",
"phonenumber": "",
"presets": "",
"recentonly": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 581f98b86..ad44e8d23 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -1766,6 +1766,7 @@
"messaging": "Messagerie",
"noallowtxt": "",
"nojobs": "",
+ "nopush": "",
"phonenumber": "",
"presets": "",
"recentonly": "",