Skip to content

Commit 7d9360c

Browse files
fix: chat not opening while bbb is open (#8433)
Co-authored-by: Mario Behling <[email protected]>
1 parent c7c7cad commit 7d9360c

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

app/components/public/stream/video-stream.hbs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
<iframe src="https://player.vimeo.com/video/{{this.vimeoId}}?autoplay={{if @videoStream.extra.autoplay 1 0}}&loop={{if @videoStream.extra.loop 1 0}}" width="100%" height="100%" frameborder="0" title="Vimeo Live Stream" allow="autoplay" allowfullscreen="true"></iframe>
1616
{{/if}}
1717
</div>
18-
<Public::Stream::SidePanel @event={{@event}} @videoStream={{@videoStream}} />
18+
<Public::Stream::SidePanel @event={{@event}} @videoStream={{@videoStream}} @shown={{true}} @showChatPanel={{this.showChatPanel}} />
1919
{{#if this.isRocketChatEnabled}}
20-
<Public::Stream::ChatPanel @event={{@event}}/>
20+
{{#if this.shown}}
21+
<Public::Stream::ChatPanel @event={{@event}} @shown={{true}} @showChatPanel={{this.showChatPanel}} />
22+
{{else}}
23+
<Public::Stream::ChatPanel @event={{@event}} @shown={{false}} @showChatPanel={{this.showChatPanel}} />
24+
{{/if}}
2125
{{/if}}

app/components/public/stream/video-stream.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ export default class PublicStreamVideoStream extends Component<Args> {
2121
@service
2222
loader!: any;
2323

24+
@service
25+
l10n: any;
26+
27+
@service
28+
confirm: any;
29+
30+
@service
31+
settings: any;
32+
2433
@service authManager: any;
2534

2635
@tracked
@@ -38,6 +47,9 @@ export default class PublicStreamVideoStream extends Component<Args> {
3847
@tracked
3948
vimeoId = '';
4049

50+
@tracked
51+
shown = false;
52+
4153
@computed()
4254
get isRocketChatEnabled(): boolean {
4355
return this.authManager.currentUser?.isRocketChatRegistered && this.args.event.isChatEnabled;
@@ -96,4 +108,38 @@ export default class PublicStreamVideoStream extends Component<Args> {
96108
location.href = stream.url;
97109
}
98110
}
111+
112+
@action
113+
async showChatPanel() {
114+
if (this.shown) {
115+
this.shown = false;
116+
return;
117+
}
118+
if (this.authManager.currentUser?.isRocketChatRegistered) {
119+
this.shown = true;
120+
return;
121+
}
122+
try {
123+
const heading = this.l10n.t('Please confirm that you understand and agree to the conditions of using the chat!');
124+
125+
const content = this.l10n.t('If you join the event chat, your profile name and image will be visible to other attendees. Other event attendees can also contact you directly.') + '<br/><br/>'
126+
+ this.l10n.t('You may change your chat name and chat profile picture by going to account settings on the chat page on the top left.') + ' '
127+
+ this.l10n.t('You need to minimize the side panel to access it.') + ' '
128+
+ this.l10n.t('The feature integration is still in Alpha stage and currently your profile on the {{appName}} account page and on the chat are not linked and can be independently edited.', { appName: this.settings.appName }) + ' '
129+
+ this.l10n.t('When you change the chat settings you may receive additional email confirmations.') + '<br/><br/>'
130+
+ this.l10n.t('Do you want to use the chat now?');
131+
132+
const options = {
133+
denyText : 'Cancel',
134+
denyColor : 'red',
135+
approveText : 'OK',
136+
approveColor : 'green',
137+
extra : content
138+
};
139+
await this.confirm.prompt(heading, options);
140+
this.shown = true;
141+
} catch {
142+
this.shown = false;
143+
}
144+
}
99145
}

0 commit comments

Comments
 (0)