mirror of
https://github.com/discourse/discourse.git
synced 2025-04-10 05:20:48 +08:00

This commit ensures we have correct icon and title on mobile for the chat header icon. It also fixes a bug where the site setting was not correctly used when the user has not yet set the user option. Both cases are now correctly tested.
13 lines
328 B
JavaScript
13 lines
328 B
JavaScript
export function getUserChatSeparateSidebarMode(user) {
|
|
let mode = user?.get("user_option.chat_separate_sidebar_mode");
|
|
if (mode === "default") {
|
|
mode = user.siteSettings.chat_separate_sidebar_mode;
|
|
}
|
|
|
|
return {
|
|
never: "never" === mode,
|
|
always: "always" === mode,
|
|
fullscreen: "fullscreen" === mode,
|
|
};
|
|
}
|