mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-21 06:35:48 +00:00
Change protocol check
This commit is contained in:
parent
d3f9e0878b
commit
f7971f7026
@ -2551,15 +2551,13 @@ class ChatPage extends LitElement {
|
||||
const initDirect = async (cid, noInitial) => {
|
||||
let timeoutId
|
||||
let initial = 0
|
||||
|
||||
let directSocketTimeout
|
||||
|
||||
let myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let nodeUrl = myNode.domain + ":" + myNode.port
|
||||
|
||||
let nodeProtocol = myNode.protocol
|
||||
let directSocketLink
|
||||
|
||||
if (window.parent.location.protocol === "https:") {
|
||||
if (nodeProtocol === "https") {
|
||||
directSocketLink = `wss://${nodeUrl}/websockets/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}&encoding=BASE64&limit=1`
|
||||
} else {
|
||||
// Fallback to http
|
||||
@ -2675,17 +2673,15 @@ class ChatPage extends LitElement {
|
||||
const initGroup = (gId, noInitial) => {
|
||||
let timeoutId
|
||||
let groupId = Number(gId)
|
||||
|
||||
let initial = 0
|
||||
let count = 0
|
||||
let groupSocketTimeout
|
||||
|
||||
let myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let nodeUrl = myNode.domain + ":" + myNode.port
|
||||
|
||||
let nodeProtocol = myNode.protocol
|
||||
let groupSocketLink
|
||||
|
||||
if (window.parent.location.protocol === "https:") {
|
||||
if (nodeProtocol === "https") {
|
||||
groupSocketLink = `wss://${nodeUrl}/websockets/chat/messages?txGroupId=${groupId}&encoding=BASE64&limit=1`
|
||||
} else {
|
||||
// Fallback to http
|
||||
|
@ -136,9 +136,10 @@ function attemptReconnectNodeStatusSocket() {
|
||||
const initBlockSocket = () => {
|
||||
let myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let nodeUrl = myNode.domain + ":" + myNode.port
|
||||
let nodeProtocol = myNode.protocol
|
||||
let activeBlockSocketLink
|
||||
|
||||
if (window.parent.location.protocol === "https:") {
|
||||
if (nodeProtocol === "https") {
|
||||
activeBlockSocketLink = `wss://${nodeUrl}/websockets/blocks`
|
||||
} else {
|
||||
activeBlockSocketLink = `ws://${nodeUrl}/websockets/blocks`
|
||||
@ -205,9 +206,10 @@ const pingactiveBlockSocket = () => {
|
||||
const initNodeStatusSocket = () => {
|
||||
let myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let nodeUrl = myNode.domain + ":" + myNode.port
|
||||
let nodeProtocol = myNode.protocol
|
||||
let activeNodeStatusSocketLink
|
||||
|
||||
if (window.parent.location.protocol === "https:") {
|
||||
if (nodeProtocol === "https") {
|
||||
activeNodeStatusSocketLink = `wss://${nodeUrl}/websockets/admin/status`
|
||||
} else {
|
||||
activeNodeStatusSocketLink = `ws://${nodeUrl}/websockets/admin/status`
|
||||
|
@ -112,9 +112,10 @@ parentEpml.subscribe('logged_in', async isLoggedIn => {
|
||||
const initChatHeadSocket = () => {
|
||||
let myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let nodeUrl = myNode.domain + ":" + myNode.port
|
||||
let nodeProtocol = myNode.protocol
|
||||
let activeChatSocketLink
|
||||
|
||||
if (window.parent.location.protocol === "https:") {
|
||||
if (nodeProtocol === "https") {
|
||||
activeChatSocketLink = `wss://${nodeUrl}/websockets/chat/active/${window.parent.reduxStore.getState().app.selectedAddress.address}?encoding=BASE64`
|
||||
} else {
|
||||
activeChatSocketLink = `ws://${nodeUrl}/websockets/chat/active/${window.parent.reduxStore.getState().app.selectedAddress.address}?encoding=BASE64`
|
||||
|
Loading…
x
Reference in New Issue
Block a user