Handle channel names ending with a slash better
This commit is contained in:
parent
f03b30eff6
commit
0f5c3b57d2
8 changed files with 96 additions and 40 deletions
|
@ -21,7 +21,7 @@ export default function initialState({ store }) {
|
|||
if (!store.getState().router.route) {
|
||||
const tab = Cookie.get('tab');
|
||||
if (tab) {
|
||||
const [server, name = null] = tab.split(':');
|
||||
const [server, name = null] = tab.split('-');
|
||||
|
||||
if (find(env.servers, srv => srv.host === server)) {
|
||||
store.dispatch(select(server, name, true));
|
||||
|
|
|
@ -16,7 +16,7 @@ class Tab extends TabRecord {
|
|||
toString() {
|
||||
let str = this.server;
|
||||
if (this.name) {
|
||||
str += `:${this.name}`;
|
||||
str += `-${this.name}`;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import Backoff from 'backo';
|
|||
export default class Socket {
|
||||
constructor(host) {
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
||||
this.url = `${protocol}://${host}/ws?path=${window.location.pathname}`;
|
||||
this.url = `${protocol}://${host}/ws${window.location.pathname}`;
|
||||
|
||||
this.connectTimeout = 20000;
|
||||
this.pingTimeout = 30000;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue