diff --git a/public/js/app.js b/public/js/app.js index 3f6900a..2643d1f 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -72,6 +72,21 @@ const APP = { channel_id }); } + + if (!document.body.dataset.channel || document.body.dataset.channel !== channel_id) { + const previous = typeof document.body.dataset.channel === 'string' ? document.body.dataset.channel : undefined; + if ( channel_id ) { + document.body.dataset.channel = channel_id; + } + else { + delete document.body.dataset.channel; + } + + this._emit( 'channel_changed', { + previous, + channel_id + }); + } }, load: async function() { @@ -234,3 +249,8 @@ const APP = { }; document.addEventListener("DOMContentLoaded", APP.load.bind( APP )); +APP.on( 'view_changed', ( { view } ) => { + if ( !view ) { + window.location.hash = '/chat'; + } +}); diff --git a/public/sidebar/sidebar.html b/public/sidebar/sidebar.html index 83e7560..4fcea1b 100644 --- a/public/sidebar/sidebar.html +++ b/public/sidebar/sidebar.html @@ -87,6 +87,11 @@ border-right: 1px solid var(--border-subtle); } + #sidebar .profile-container { + width: 100%; + max-width: 100%; + } + #sidebar #sidebar-context-menu { display: none; visibility: hidden; diff --git a/public/tabs/chat/channel_sidebar.html b/public/tabs/chat/channel_sidebar.html index 4e28bb9..8ac59fa 100644 --- a/public/tabs/chat/channel_sidebar.html +++ b/public/tabs/chat/channel_sidebar.html @@ -1,7 +1,10 @@