successfully connecting to prod

This commit is contained in:
metacryst
2026-03-17 07:00:27 -05:00
parent 530ea7da89
commit d1e4814593
7 changed files with 43 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
import { Preferences } from '@capacitor/preferences';
const env = import.meta.env
import util from "../../../util.js"
class Connection {
connectionTries = 0;
@@ -14,8 +14,8 @@ class Connection {
const { value: token } = await Preferences.get({ key: 'auth_token' });
return new Promise((resolve, reject) => {
let url = ""
if(env.VITE_API_URL) {
url = "wss://" + env.VITE_API_URL.replace(/^https?:\/\//, '') + "/ws" + `?token=${token}`;
if(util.HOST) {
url = "wss://" + util.HOST.replace(/^https?:\/\//, '') + "/ws" + `?token=${token}`;
} else {
url = "ws://" + window.location.host + "/ws"
}