remove .env file(electron not picking it up)
This commit is contained in:
parent
716730fdd2
commit
7dbf4e6aa6
10 changed files with 29 additions and 13 deletions
|
|
@ -70,7 +70,7 @@ const onLogin = async (
|
|||
resolve(parsed.profile);
|
||||
|
||||
} catch(e) {
|
||||
console.log('[API]', e.response);
|
||||
console.log('[API]', e);
|
||||
reject(new Error('Failed to authenticate'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,10 @@ let state: SessionState;
|
|||
// Calls appropriate endpoint for a server message.
|
||||
const onMessage = (data: string): void => {
|
||||
let message = JSON.parse(data);
|
||||
console.log('received new message', message);
|
||||
if (message === "CLOSE_AUTH_FAIL") {
|
||||
ipcEmit("session-auth-fail", null)
|
||||
return;
|
||||
}
|
||||
|
||||
// Standard message.
|
||||
if (message.content) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import WebSocket from 'ws';
|
|||
|
||||
let socket: WebSocket;
|
||||
|
||||
const socketUrl = process.env.PLATFORM_URL;
|
||||
const socketUrl = "ws://127.0.0.1:8760"
|
||||
|
||||
// Run every time we want to connect to backend.
|
||||
export default function useWebSockets(
|
||||
|
|
@ -53,7 +53,7 @@ export default function useWebSockets(
|
|||
|
||||
}
|
||||
|
||||
const onClose = (_event: WebSocket.CloseEvent) => {
|
||||
const onClose = (event: WebSocket.CloseEvent) => {
|
||||
console.log("WS:Socket closed normally.")
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,6 @@ export default function useWebSockets(
|
|||
token: string;
|
||||
crimataId: string;
|
||||
}) => {
|
||||
if (socketUrl)
|
||||
socket = new WebSocket(socketUrl)
|
||||
|
||||
// Add listeners.
|
||||
|
|
|
|||
Loading…
Reference in a new issue