From 17cd38f0b9e11183da23e1f773617183eae383f6 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 26 May 2021 22:57:21 +0200 Subject: [PATCH] Read auto-join channels from browser URL hash This is easier to type than trying to escape the # in ?channels=#XXX. --- components/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/app.js b/components/app.js index 1a10e85..197c0d4 100644 --- a/components/app.js +++ b/components/app.js @@ -252,6 +252,10 @@ export default class App extends Component { connectParams.autojoin = queryParams.channels.split(","); } + if (window.location.hash) { + connectParams.autojoin = window.location.hash.split(","); + } + this.setState((state) => { return { connectParams: { ...state.connectParams, ...connectParams } }; });