Skip to content

Commit

Permalink
fix: add comments block when stream ends (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgithubprofile authored Oct 9, 2023
1 parent be0a653 commit ff8a621
Show file tree
Hide file tree
Showing 4 changed files with 2,562 additions and 279 deletions.
122 changes: 66 additions & 56 deletions components/lenta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3173,91 +3173,101 @@ var lenta = (function(){

var share = self.psdk.share.get(txid)

if(!share || share.itisstream()){
if(!share){

if(clbk) clbk()

return
}


var checkvisibility = share ? app.platform.sdk.node.shares.checkvisibility(share) : false;
if(share.itisstream()){

//self.fastTemplate('commentspreview', function(rendered){
var meta = window.parseVideo(share.url)
if (meta){
var state = window.peertubeglobalcache[meta.id]

if (state && state.isLive){
if(clbk) clbk()
return
}
}

if(!el.c) return
}

var e = el.c.find('#' + txid);
var checkvisibility = share ? app.platform.sdk.node.shares.checkvisibility(share) : false;

var rf = ''
if(!el.c) return

if (self.app.user.address.value){
rf = '&ref=' + self.app.user.address.value
}
var e = el.c.find('#' + txid);

var hr = 'https://'+self.app.options.url+'/' + (essenseData.hr || 'index?') + 's='+txid+'&mpost=true' + rf
var rf = ''

if (parameters().address) hr += '&address=' + (parameters().address || '')
if (self.app.user.address.value){
rf = '&ref=' + self.app.user.address.value
}

self.nav.api.load({
open : true,
id : 'comments',
el : _el,
var hr = 'https://'+self.app.options.url+'/' + (essenseData.hr || 'index?') + 's='+txid+'&mpost=true' + rf

eid : txid + 'lenta',

if (parameters().address) hr += '&address=' + (parameters().address || '')

essenseData : {
close : true,
totop : el.c.find('#' + txid),
//caption : rendered,
/*send : function(comment, last){
self.nav.api.load({
open : true,
id : 'comments',
el : _el,

var c = el.c.find('#' + txid + " .commentsAction .count span");
eid : txid + 'lenta',


c.html(Number(c.html() || "0") + 1)
essenseData : {
close : true,
totop : el.c.find('#' + txid),
//caption : rendered,
/*send : function(comment, last){
share.lastComment = last
},*/
var c = el.c.find('#' + txid + " .commentsAction .count span");
txid : txid,
showall : essenseData.comments == 'all' || showall,
fromtop: essenseData.comments == 'all' || e.hasClass('fullScreenVideo') || false,
preview : true, // essenseData.comments == 'all' ? false : preview,
listpreview : essenseData.comments == 'all' ? false : preview,
//lastComment : essenseData.comments != 'all' ? share.lastComment : null,

init : essenseData.comments == 'all' ? false : init,
hr : hr,
receiver: share.address,
cantsend : checkvisibility,
renderClbk : function(){
c.html(Number(c.html() || "0") + 1)
essenserenderclbk()
},
share.lastComment = last
},*/

previewClbk : function(){
if(clbk) clbk()
}
txid : txid,
showall : essenseData.comments == 'all' || showall,
fromtop: essenseData.comments == 'all' || e.hasClass('fullScreenVideo') || false,
preview : true, // essenseData.comments == 'all' ? false : preview,
listpreview : essenseData.comments == 'all' ? false : preview,
//lastComment : essenseData.comments != 'all' ? share.lastComment : null,

init : essenseData.comments == 'all' ? false : init,
hr : hr,
receiver: share.address,
cantsend : checkvisibility,
renderClbk : function(){

essenserenderclbk()
},

clbk : function(e, p){
previewClbk : function(){
if(clbk) clbk()
}
},

clbk : function(e, p){

if(!el.c) return


if (p)
initedcommentes[txid] = p
if(!el.c) return

essenserenderclbk()
if (p)
initedcommentes[txid] = p


}
})
essenserenderclbk()

/*}, {
share : share
})*/

}
})



},

Expand Down
12 changes: 11 additions & 1 deletion js/satolist.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,17 @@ Platform = function (app, listofnodes) {
'PQDfbq9MetJYpVkTRzRmDcLgm5ZkDnDEwt': true,
'PNoBxRYhNuAzs5jtwaWhcgETwFkw7dagq5': true,
'PSs2u1WfWjmbUW6hF3sj3unHya4Ke4rF9Z': true,
'P9sathm4yQJEH6SMvgC2CCLEXSqVWxSHtj': true
'P9sathm4yQJEH6SMvgC2CCLEXSqVWxSHtj': true,
'PMH5ohh5bGXiYX7Z37TPyDP5dtCe5Domp4': true,
'PWXqxFeZdmYT4CoFq6bQr9yiwvRYRdFC2w': true,
'PTv5T49uhB4VGtwDUT2iwCCBWyGrErRGQJ': true,
'PK2ETYEuDHiWf2ncGuq3TjGfpXEUdGxuYE': true,
'PDVFC7FgKSFvcZcEpAVNQsUEGZ4ngcovoU': true,
'PB9vK57cbgMjqmkrKQqqMyBkky3kzhQCAT': true,
'PXVp4QeaaomcREBJXuzH34GWiiinNby6HA': true,
'PXupozgNg1Ee6Nrbapj8DEfMGCVgWi4GB1': true,
'PLm44qx3ArWbd46dKybCc43dwr2WFn8dT6': true,
'PLpjFQ67uxgvvk1GdKFrdXacWj6jr9wHSm': true
}

self.bch = {
Expand Down
Loading

0 comments on commit ff8a621

Please sign in to comment.