Add environment variable in frontend and ssl

This commit is contained in:
Ricardo Paes
2022-02-14 08:27:05 -03:00
parent 7a4e908421
commit ac84639687
30 changed files with 207 additions and 77 deletions

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect, useReducer, useContext } from "react";
import openSocket from "socket.io-client";
import openSocket from "../../services/socket-io";
import { toast } from "react-toastify";
import { useHistory } from "react-router-dom";
@@ -130,7 +130,7 @@ const Contacts = () => {
}, [searchParam, pageNumber]);
useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
const socket = openSocket();
socket.on("contact", (data) => {
if (data.action === "update" || data.action === "create") {

View File

@@ -1,6 +1,6 @@
import React, { useEffect, useReducer, useState } from "react";
import openSocket from "socket.io-client";
import openSocket from "../../services/socket-io";
import {
Button,
@@ -111,7 +111,7 @@ const Queues = () => {
}, []);
useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
const socket = openSocket();
socket.on("queue", (data) => {
if (data.action === "update" || data.action === "create") {

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect, useReducer } from "react";
import openSocket from "socket.io-client";
import openSocket from "../../services/socket-io";
import {
Button,
@@ -122,7 +122,7 @@ const QuickAnswers = () => {
}, [searchParam, pageNumber]);
useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
const socket = openSocket();
socket.on("quickAnswer", (data) => {
if (data.action === "update" || data.action === "create") {

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import openSocket from "socket.io-client";
import openSocket from "../../services/socket-io";
import { makeStyles } from "@material-ui/core/styles";
import Paper from "@material-ui/core/Paper";
@@ -55,7 +55,7 @@ const Settings = () => {
}, []);
useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
const socket = openSocket();
socket.on("settings", data => {
if (data.action === "update") {

View File

@@ -1,6 +1,6 @@
import React, { useState, useEffect, useReducer } from "react";
import { toast } from "react-toastify";
import openSocket from "socket.io-client";
import openSocket from "../../services/socket-io";
import { makeStyles } from "@material-ui/core/styles";
import Paper from "@material-ui/core/Paper";
@@ -122,7 +122,7 @@ const Users = () => {
}, [searchParam, pageNumber]);
useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
const socket = openSocket();
socket.on("user", (data) => {
if (data.action === "update" || data.action === "create") {