diff --git a/jam-ui/src/App.js b/jam-ui/src/App.js index 0e4a11df1..c89603aa9 100644 --- a/jam-ui/src/App.js +++ b/jam-ui/src/App.js @@ -8,6 +8,9 @@ import 'react-image-lightbox/style.css'; import useScript from './hooks/useScript'; +import { useDispatch } from "react-redux"; +//import { addMessage } from "./store/features/textMessagesSlice" + const App = () => { function initJKScripts() { @@ -38,13 +41,18 @@ const App = () => { function registerTextMessageCallback(){ window.JK.JamServer.registerMessageCallback(window.JK.MessageType.TEXT_MESSAGE, function(header, payload) { - console.log('Handling CHAT_MESSAGE msg ' + JSON.stringify(payload)); + console.log('Handling TEXT_MESSAGE ' + JSON.stringify(payload)); // chatMessageReceived(payload); // context.ChatActions.msgReceived(payload); // handledNotification(payload); + + //dispatch(addMessage()) + }); } + const dispatch = useDispatch() + useScript(`${process.env.REACT_APP_LEGACY_BASE_URL}/client_scripts`, initJKScripts); return ( diff --git a/jam-ui/src/Main.js b/jam-ui/src/Main.js index 012569208..c16ef7cce 100644 --- a/jam-ui/src/Main.js +++ b/jam-ui/src/Main.js @@ -5,6 +5,8 @@ import { AuthProvider } from "./context/AuthContext"; import { settings } from './config'; import toggleStylesheet from './helpers/toggleStylesheet'; import { getItemFromStore, setItemToStore, themeColors } from './helpers/utils'; +import store from './store/store'; +import { Provider } from 'react-redux'; const Main = props => { const [isFluid, setIsFluid] = useState(getItemFromStore('isFluid', settings.isFluid)); @@ -117,7 +119,9 @@ const Main = props => { return - {props.children} + + {props.children} + ; }; diff --git a/jam-ui/src/components/navbar/NavbarTop.js b/jam-ui/src/components/navbar/NavbarTop.js index fc0fac8dc..85ea674b5 100644 --- a/jam-ui/src/components/navbar/NavbarTop.js +++ b/jam-ui/src/components/navbar/NavbarTop.js @@ -45,7 +45,7 @@ const NavbarTop = () => { -