mirror of
https://github.com/PretendoNetwork/juxtaposition-ui.git
synced 2026-09-14 12:25:36 -05:00
Fixed notifications getting spammed when user repeatedly follows and unfollows a user
This commit is contained in:
@@ -200,7 +200,10 @@ router.post('/follow', upload.none(), async function (req, res) {
|
||||
userToFollow.addToFollowers(user.pid);
|
||||
user.addToUsers(userToFollow.pid);
|
||||
res.sendStatus(200);
|
||||
await database.pushNewNotificationByPID(userToFollow.pid, user.user_id + ' ' + req.lang.notifications.new_follower, '/users/show?pid=' + user.pid)
|
||||
let content = user.user_id + ' ' + req.lang.notifications.new_follower;
|
||||
var picked = userToFollow.notification_list.find(o => o.content === content);
|
||||
if(picked === undefined)
|
||||
await database.pushNewNotificationByPID(userToFollow.pid, content, '/users/show?pid=' + user.pid)
|
||||
}
|
||||
else if(req.body.type === 'false' && user !== null && user.followed_users.indexOf(userToFollow.pid) !== -1)
|
||||
{
|
||||
|
||||
@@ -1136,6 +1136,10 @@ h4 {
|
||||
.community-page-post-wrapper > h3 {
|
||||
padding-left: 0;
|
||||
overflow-wrap: break-word;
|
||||
width: 760px;
|
||||
max-width: 760px;
|
||||
line-break: anywhere;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.community-page-post-screenshot {
|
||||
|
||||
@@ -287,8 +287,6 @@ function followUser(user) {
|
||||
var userWrapper = user.parentElement;
|
||||
var followersElement = document.getElementById('user-page-followers-tab');
|
||||
var followers = followersElement.innerHTML.trim().substr(0, followersElement.innerHTML.indexOf(' ') + 1);
|
||||
alert(followersElement.innerHTML)
|
||||
alert('"' + followers + '"')
|
||||
if (userWrapper.classList.contains("selected")) {
|
||||
userWrapper.classList.remove("selected");
|
||||
user.style.color = '#673DB6';
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
|
||||
<%}%>
|
||||
<% if(post.url) { %>
|
||||
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
<iframe width="760" height="427.5" src="<%= post.url.replace('watch?v=','embed/') %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
<%}%>
|
||||
<% if(post.screenshot !== '' && post.body && post.body.size <= 50) { %>
|
||||
<div class="community-page-post-text-overlay">
|
||||
|
||||
Reference in New Issue
Block a user