Skip to content

Commit 922e76c

Browse files
committed
figure out different way to fix setting title on load instead
1 parent 7cd6b55 commit 922e76c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

resources/js/chat/chat-state-store.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,15 @@ export default class ChatStateStore implements DispatchListener {
123123
}
124124
});
125125

126+
// This should really go in ConversationPanel expect the whole double mounted thing wuth turbolinks breaks it when navigating.
126127
autorun(() => {
127128
if (this.isChatMounted) {
128129
const selectedChannelOrType = this.selectedChannelOrType;
129130
const channelName = selectedChannelOrType instanceof Channel
130131
? selectedChannelOrType.name
131132
: trans(`chat.channels.${selectedChannelOrType ?? 'none'}`);
132133

133-
const newTitle = `${channelName} · ${trans('page_title.main.chat_controller._')}`;
134-
document.title = newTitle; // initial page load resets to document.title.
135-
core.browserTitleWithNotificationCount.title = newTitle;
134+
core.browserTitleWithNotificationCount.title = `${channelName} · ${trans('page_title.main.chat_controller._')}`;
136135
}
137136
});
138137
}

0 commit comments

Comments
 (0)