Skip to content

Commit

Permalink
do not establish websocket connection if login key doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
yylyyl committed Dec 4, 2023
1 parent 52c789e commit bdedbbe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/src/lib/dataProvidor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import dataModel from "./dataModel";

const makeAioConnection = (onData, onOpen, onError, onClose) => {
const [loginKey, prefix] = dataModel.getLoginKeyAndPrefix();
if (!loginKey) {
setTimeout(() => onError(dataModel.errors.errNoLogin));
return [() => {}, () => {}];
}

let protocol = 'ws:';
if (window.location.protocol === 'https:') {
Expand Down

0 comments on commit bdedbbe

Please sign in to comment.