diff --git a/client/src/components/menu.vue b/client/src/components/menu.vue index ae4f546..ead446b 100644 --- a/client/src/components/menu.vue +++ b/client/src/components/menu.vue @@ -83,16 +83,12 @@ this.$i18n.locale = default_lang } const show_side = new URL(location.href).searchParams.get('show_side') - if (show_side && show_side === 'true') { - this.$accessor.client.showSide() - } else if (show_side && show_side === 'false') { - this.$accessor.client.hideSide() + if (show_side !== null) { + this.$accessor.client.setSide(show_side === '1') } const mute_chat = new URL(location.href).searchParams.get('mute_chat') - if (mute_chat && mute_chat === 'true') { - this.$accessor.settings.setSound(false) - } else if (mute_chat && mute_chat === 'false') { - this.$accessor.settings.setSound(true) + if (mute_chat !== null) { + this.$accessor.settings.setSound(mute_chat !== '1') } } } diff --git a/client/src/store/client.ts b/client/src/store/client.ts index fcc7eb0..7d63baa 100644 --- a/client/src/store/client.ts +++ b/client/src/store/client.ts @@ -27,13 +27,9 @@ export const mutations = mutationTree(state, { state.side = !state.side set('side', state.side) }, - showSide(state) { - state.side = true - set('side', state.side) - }, - hideSide(state) { - state.side = false - set('side', state.side) + setSide(state, side: boolean) { + state.side = side + set('side', side) }, }) diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index d77d74e..368d1b6 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -257,8 +257,8 @@ NEKO_BROADCAST_PIPELINE: "flvmux name=mux ! rtmpsink location={url} pulsesrc dev - Adding `?embed=1` will hide most additional components and show only video. - Adding `?volume=<0-1>` will set volume to given value. - Adding `?lang=` will set language to given value. - - Adding `?show_side=true` will show the sidebar on startup. - - Adding `?mute_chat=true` will mute the chat on startup. + - Adding `?show_side=1` will show the sidebar on startup. + - Adding `?mute_chat=1` will mute the chat on startup. - e.g. `http(s):///?pwd=neko&usr=guest&cast=1` ### Screen size