automating devops
This commit is contained in:
parent
6db693f9d3
commit
69dc3177ee
4 changed files with 12 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Crimata",
|
||||
"version": "0.9.8",
|
||||
"version": "0.9.9",
|
||||
"private": true,
|
||||
"description": "Cross-platform messenger application built with electron, vue3, and TS.",
|
||||
"author": {
|
||||
|
|
|
|||
|
|
@ -39,14 +39,14 @@ autoUpdater.on('update-downloaded', (info: any) => {
|
|||
})
|
||||
|
||||
// Run when electron app is initialized.
|
||||
async function main() {
|
||||
async function main(dev: boolean) {
|
||||
console.log("MAIN:Initializing Electron App.")
|
||||
|
||||
// Must wait til window is created.
|
||||
await createWindow();
|
||||
|
||||
// Instantiate socket session with crimata-platorm.
|
||||
initSession();
|
||||
initSession(dev);
|
||||
|
||||
// Begin audio stream.
|
||||
initAudioIO();
|
||||
|
|
@ -58,8 +58,8 @@ export function initApp(dev: boolean): void {
|
|||
|
||||
// On initial startup.
|
||||
app.on("ready", () => {
|
||||
autoUpdater.checkForUpdates()
|
||||
main()
|
||||
if (!dev) autoUpdater.checkForUpdates()
|
||||
main(dev)
|
||||
});
|
||||
|
||||
// Must keep to ensure app doesn't quit on close.
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ const onClientMessage = (_event: IpcMainEvent, payload: any) => {
|
|||
}
|
||||
|
||||
// Call this to initialize session with Crimata servers.
|
||||
export const initSession = () => {
|
||||
export const initSession = (dev: boolean) => {
|
||||
console.log("SESS:Creating new session.")
|
||||
|
||||
// Load Json or createState.
|
||||
|
|
@ -148,7 +148,9 @@ export const initSession = () => {
|
|||
` new: ${state.newMessages}`)
|
||||
|
||||
// Open socket connection.
|
||||
createSocket()
|
||||
let url = "ws://crimata.com:8760";
|
||||
if (dev) url = "ws://localhost:8760";
|
||||
createSocket(url)
|
||||
|
||||
// Attack browser window init listener.
|
||||
ipcMain.removeAllListeners("app-mounted")
|
||||
|
|
|
|||
|
|
@ -52,8 +52,9 @@ export default function useWebSockets(receiveCallback: (s: string) => any, openC
|
|||
setTimeout(createSocket, 1000)
|
||||
}
|
||||
|
||||
const createSocket = () => {
|
||||
socket = new WebSocket(`ws://crimata.com:8760`)
|
||||
const createSocket = (url: string) => {
|
||||
|
||||
socket = new WebSocket(url)
|
||||
|
||||
// Add listeners.
|
||||
socket.addEventListener("open", onOpen)
|
||||
|
|
|
|||
Loading…
Reference in a new issue