@@ -12,7 +12,7 @@ import Alert from '@mui/material/Alert';
1212import Stack from '@mui/material/Stack' ;
1313//SqliteCloud
1414const config = require ( './config' ) . config ;
15- const utils = require ( './utils' ) ;
15+ import { logThis } from './utils'
1616import { StateProvider } from './context/StateContext' ;
1717//SqliteCloud components
1818import ChannelsList from "./ChannelsList"
@@ -22,7 +22,7 @@ import Messages from "./Messages"
2222import { Liter } from "js-sdk"
2323
2424const App = ( ) => {
25- if ( config . debug . renderingProcess ) utils . logThis ( "App: ON RENDER" ) ;
25+ if ( config . debug . renderingProcess ) logThis ( "App: ON RENDER" ) ;
2626 //credentials to establish the websocket connection
2727 var projectId = config . credential . projectId ;
2828 var apikey = config . credential . apikey ;
@@ -72,13 +72,13 @@ const App = () => {
7272
7373 useEffect ( ( ) => {
7474 const onMountWrapper = async ( ) => {
75- if ( config . debug . renderingProcess ) utils . logThis ( "App: ON useEffect" ) ;
75+ if ( config . debug . renderingProcess ) logThis ( "App: ON useEffect" ) ;
7676 //init Liter instance using provided credentials
7777 let locaLiter = new Liter ( projectId , apikey , onErrorCallback , onCloseCallback ) ;
7878 //try to enstablish websocket connection
7979 const connectionResponse = await locaLiter . connect ( ) ;
8080 setConnectionResponse ( connectionResponse ) ;
81- if ( config . debug . renderingProcess ) utils . logThis ( connectionResponse . message ) ;
81+ if ( config . debug . renderingProcess ) logThis ( connectionResponse . message ) ;
8282 if ( connectionResponse . status == "success" ) {
8383 setLiter ( locaLiter )
8484 //based on query parameters select if retrieve tabales db or channels
@@ -92,7 +92,7 @@ const App = () => {
9292 }
9393 setChannelsListResponse ( channelsListResponse ) ;
9494 if ( channelsListResponse . status == "success" ) {
95- if ( config . debug . renderingProcess ) utils . logThis ( "Received channels list" ) ;
95+ if ( config . debug . renderingProcess ) logThis ( "Received channels list" ) ;
9696 var channels = [ ] ;
9797 if ( queryDBName !== null ) {
9898 channelsListResponse . data . rows . forEach ( c => {
@@ -140,10 +140,10 @@ const App = () => {
140140 setOpenMobMsg ( false ) ;
141141 }
142142 } else {
143- if ( config . debug . renderingProcess ) utils . logThis ( channelsListResponse . data . message ) ;
143+ if ( config . debug . renderingProcess ) logThis ( channelsListResponse . data . message ) ;
144144 }
145145 } else {
146- if ( config . debug . renderingProcess ) utils . logThis ( connectionResponse . data . message ) ;
146+ if ( config . debug . renderingProcess ) logThis ( connectionResponse . data . message ) ;
147147 }
148148 }
149149 onMountWrapper ( ) ;
0 commit comments