File tree 2 files changed +19
-3
lines changed
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change
1
+ < script >
2
+ function updateLiveStats ( ) {
3
+ $ . getJSON ( <%== live_stream_stats_path ( @user . username ) . to_json %> , function ( data ) {
4
+ var connections = 0 ;
5
+ if ( data ) {
6
+ connections = data . connections ;
7
+ }
8
+
9
+ $ ( '#js-live-viewers' ) . text ( connections )
10
+ } )
11
+ }
12
+ setInterval ( updateLiveStats , 5000 )
13
+ updateLiveStats ( )
14
+ </ script >
Original file line number Diff line number Diff line change 48
48
-# follow
49
49
-# donate
50
50
51
- .right.diminish.px1
52
- =icon(" eye" , class: 'h5')
53
- %span#js-live-viewers
51
+ - if @stream.active
52
+ .right.diminish.px1
53
+ =icon(" eye" , class: 'h5')
54
+ %span#js-live-viewers
54
55
55
56
%a.right.diminish.px1.pointer{href: "mailto:support@coderwall.com?subject=reporting%20#{@user.username}"}
56
57
=icon('flag', class: 'h5')
91
92
#bsap_1305410.bsarocks.bsap_74f50e679004d8f4d62fec4b0f74ccf1
92
93
93
94
= render 'chat'
95
+ = render 'live_stats'
You can’t perform that action at this time.
0 commit comments