Skip to content

Commit 9d05813

Browse files
authored
Merge pull request #12868 from nanaya/chat-empty-join
Show join public channel page if not currently in any channels
2 parents 50fa24e + ae50c62 commit 9d05813

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

resources/js/chat/conversation-panel.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import ConversationView from './conversation-view';
1212
import CreateAnnouncement from './create-announcement';
1313
import JoinChannels from './join-channels';
1414

15-
const lazerLink = 'https://github.com/ppy/osu/releases';
16-
1715
@observer
1816
export default class ConversationPanel extends React.Component<Record<string, never>> {
1917
private readonly disposer: ReturnType<typeof autorun>;
@@ -66,29 +64,20 @@ export default class ConversationPanel extends React.Component<Record<string, ne
6664
return <CreateAnnouncement />;
6765
}
6866

69-
if (selected === 'join') {
67+
if (selected === 'join' || core.dataStore.channelStore.channels.size === 0) {
7068
return <JoinChannels />;
7169
}
7270

7371
if (selected != null) {
7472
return <ConversationView />;
7573
}
7674

75+
// requested channel not found
7776
return (
7877
<div className='chat-conversation-panel__no-channel'>
7978
<Img2x alt='Art by Badou_Rammsteiner' src='/images/layout/chat/none-yet.png' title='Art by Badou_Rammsteiner' />
80-
{core.dataStore.channelStore.channels.size > 0 ? (
81-
<>
82-
<div className='chat-conversation-panel__title'>{trans('chat.not_found.title')}</div>
83-
<div className='chat-conversation-panel__instructions'>{trans('chat.not_found.message')}</div>
84-
</>
85-
) : (
86-
<>
87-
<div className='chat-conversation-panel__title'>{trans('chat.no-conversations.title')}</div>
88-
<div className='chat-conversation-panel__instructions'>{trans('chat.no-conversations.howto')}</div>
89-
<div dangerouslySetInnerHTML={{ __html: trans('chat.no-conversations.lazer', { link: lazerLink }) }} />
90-
</>
91-
)}
79+
<div className='chat-conversation-panel__title'>{trans('chat.not_found.title')}</div>
80+
<div className='chat-conversation-panel__instructions'>{trans('chat.not_found.message')}</div>
9281
</div>
9382
);
9483
}

resources/js/chat/main-view.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export default class MainView extends React.Component<Record<string, never>> {
4545
componentDidMount() {
4646
runInAction(() => {
4747
core.dataStore.chatState.viewsMounted.add(this);
48+
if (core.dataStore.channelStore.channels.size === 0 && core.dataStore.chatState.selectedChannelOrType == null) {
49+
core.dataStore.chatState.selectChannel('join');
50+
}
4851
});
4952
}
5053

@@ -59,7 +62,7 @@ export default class MainView extends React.Component<Record<string, never>> {
5962
<>
6063
<HeaderV4 theme='chat' />
6164
<div className='chat osu-page osu-page--chat'>
62-
{core.dataStore.channelStore.channels.size > 0 && <ConversationList />}
65+
<ConversationList />
6366
<ConversationPanel />
6467
</div>
6568
</>

resources/lang/en/chat.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
'send' => 'Send',
5959
],
6060

61-
'no-conversations' => [
62-
'howto' => "Start conversations from a user's profile or a usercard popup.",
63-
'lazer' => 'Public channels you join via <a href=":link">osu!lazer</a> will also be visible here.',
64-
'title' => 'no conversations yet',
65-
],
66-
6761
'join_channels' => [
6862
'loading' => 'Loading channel list...',
6963
],

0 commit comments

Comments
 (0)