successfully connecting to prod
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user