Skip to content

Commit

Permalink
fix: accounts list in userinfo (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgithubprofile authored Oct 2, 2023
1 parent 1ce64f7 commit 0efacd4
Show file tree
Hide file tree
Showing 39 changed files with 706 additions and 344 deletions.
3 changes: 2 additions & 1 deletion chat/matrix-element.7.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chat/matrix-element.7.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion chat/matrix-element.7.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion chat/matrix-element.7.min.js.map

Large diffs are not rendered by default.

110 changes: 61 additions & 49 deletions components/author/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,9 @@ var author = (function(){
return !self.app.curation()
},
count : function(){

return deep(author, 'data.subscribers_count') || 0

var u = _.map(deep(author, 'data.subscribers') || [], function(a){
return a
})

var blocked = deep(author, 'data.blocking') || []

u = _.filter(u, function(a){
return _.indexOf(blocked, a) == -1
})

return u.length

}
},
Expand All @@ -254,6 +245,9 @@ var author = (function(){
return !self.app.curation()
},
count : function(){


return deep(author, 'data.subscribes_count') || 0

var u = _.map(deep(author, 'data.subscribes') || [], function(a){
return a.adddress
Expand All @@ -279,6 +273,10 @@ var author = (function(){
if(self.user.isItMe(author.address)) return true
},
count : function(){

console.log('author', author)

return deep(author, 'data.blockings_count') || 0

var blocked = deep(author, 'data.blocking') || []

Expand Down Expand Up @@ -775,64 +773,78 @@ var author = (function(){

followers : function(_el, report){

var u = _.map(deep(author, 'data.subscribers') || [], function(a){
return a
})
author.data.loadRelations(['subscribes', 'blocking'], self.app.platform.sdk.user.loadRelation).then(() => {

var blocked = deep(author, 'data.blocking') || []
var u = _.map(deep(author, 'data.subscribers') || [], function(a){
return a
})

var blocked = deep(author, 'data.blocking') || []

u = _.filter(u, function(a){
return _.indexOf(blocked, a) == -1
})

var e = self.app.localization.e('anofollowers');

if(self.user.isItMe(author.address)){
e = self.app.localization.e('aynofollowers')
}

renders.userslist(_el, u, e, self.app.localization.e('followers'), function(e, p){
report.module = p;
})

u = _.filter(u, function(a){
return _.indexOf(blocked, a) == -1
})

var e = self.app.localization.e('anofollowers');

if(self.user.isItMe(author.address)){
e = self.app.localization.e('aynofollowers')
}

renders.userslist(_el, u, e, self.app.localization.e('followers'), function(e, p){
report.module = p;
})

},

following : function(_el, report){

var u = _.map(deep(author, 'data.subscribes') || [], function(a){
return a.adddress
})
author.data.loadRelations(['subscribes', 'blocking'], self.app.platform.sdk.user.loadRelation).then(() => {

var blocked = deep(author, 'data.blocking') || []
var u = _.map(deep(author, 'data.subscribes') || [], function(a){
return a.adddress
})

u = _.filter(u, function(a){
return _.indexOf(blocked, a) == -1
})
var blocked = deep(author, 'data.blocking') || []

u = _.filter(u, function(a){
return _.indexOf(blocked, a) == -1
})

var e = self.app.localization.e('anofollowing');
var e = self.app.localization.e('anofollowing');

if(self.user.isItMe(author.address)){
e = self.app.localization.e('aynofollowing')
}
if(self.user.isItMe(author.address)){
e = self.app.localization.e('aynofollowing')
}

renders.userslist(_el, u, e, self.app.localization.e('following'), function(e, p){
report.module = p;
})

renders.userslist(_el, u, e, self.app.localization.e('following'), function(e, p){
report.module = p;
})
},

blocking : function(_el, report){

var u = _.map(deep(author, 'data.blocking') || [], function(a){
return a
})
author.data.loadRelations(['blocking'], self.app.platform.sdk.user.loadRelation).then(() => {

var e = self.app.localization.e('anoblocked');
var u = _.map(deep(author, 'data.blocking') || [], function(a){
return a
})

if(self.user.isItMe(author.address)){
e = self.app.localization.e('aynoblocked')
}
var e = self.app.localization.e('anoblocked');

if(self.user.isItMe(author.address)){
e = self.app.localization.e('aynoblocked')
}

renders.userslist(_el, u, e, self.app.localization.e('blockedusers'), function(e, p){
report.module = p;
})

renders.userslist(_el, u, e, self.app.localization.e('blockedusers'), function(e, p){
report.module = p;
})
},

Expand Down Expand Up @@ -1578,7 +1590,7 @@ var author = (function(){

}

})
}, true)


return
Expand Down
4 changes: 2 additions & 2 deletions components/channel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var channel = (function(){
history : true,

count : function(){
return deep(author, 'data.subscribers.length') || 0
return deep(author, 'data.subscribers_count') || 0
}
},

Expand All @@ -58,7 +58,7 @@ var channel = (function(){
history : true,

count : function(){
return deep(author, 'data.subscribes.length') || 0
return deep(author, 'data.subscribes_count') || 0
}
}
}
Expand Down
18 changes: 16 additions & 2 deletions components/comments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3168,8 +3168,22 @@ var comments = (function(){

var post = share;

if (listpreview){
makePreview(() => {
if(ed.previewClbk) ed.previewClbk()
})
} else{
make();

if (ed.showall){
actions.showall()
}
}

initEvents();

/* !Post with stream */
if (!post || !post.settings.c) {
/*if (!post || !post.settings.c) {
if (listpreview){
makePreview(() => {
if(ed.previewClbk) ed.previewClbk()
Expand All @@ -3191,7 +3205,7 @@ var comments = (function(){
} else {
holder.hide();
}
}
}*/

p.clbk(null, p);
},
Expand Down
2 changes: 2 additions & 0 deletions components/donate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var donate = (function(){
transaction.feemode.set('include')
transaction.message.set('')



return transaction

},
Expand Down
8 changes: 7 additions & 1 deletion components/lenta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4347,6 +4347,8 @@ var lenta = (function(){

var author = essenseData.author;

console.log('allshares', allshares)

self.app.platform.sdk.node.shares.loadvideoinfoifneed(allshares, video, function(){

self.app.platform.sdk.node.shares.users(allshares, function(l, error2){
Expand Down Expand Up @@ -4698,6 +4700,8 @@ var lenta = (function(){

var period = 1440

console.log("HERE")

self.app.platform.sdk.node.shares[loader]({

author : author,
Expand Down Expand Up @@ -4727,6 +4731,8 @@ var lenta = (function(){
shares = _.shuffle(shares)
}

console.log('shares', shares)

load.sstuff(shares, error, pr, clbk, bshares, includingsub)

if (recommended == 'b'){
Expand Down Expand Up @@ -5451,7 +5457,7 @@ var lenta = (function(){

getdata : function(clbk, p){


console.log('getdata')
ovf = false

newmaterials = 0;
Expand Down
4 changes: 4 additions & 0 deletions components/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,12 @@ var main = (function(){
loader = function(clbk){
var _clbk = function(shares){

shares = _.filter(shares, (s) => {return s})

self.app.psdk.share.insertFromResponseSmall(shares)

console.log('shares', shares)

var shares = self.app.psdk.share.gets(_.map(shares, (s) => {
return s.txid
}))
Expand Down
2 changes: 1 addition & 1 deletion components/menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ var menu = (function(){

clbk(data)

})
}, true)


}
Expand Down
3 changes: 0 additions & 3 deletions components/post/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,6 @@
border-radius: 12px;
background: #000;
}
#post.videomainpost .statswrapperExtended {
display: none;
}
#post.videomainpost .share {
margin: 0 auto;
/*max-width: 960px;*/
Expand Down
Loading

0 comments on commit 0efacd4

Please sign in to comment.