diff --git a/static/fedilove-no-react.js b/static/fedilove-no-react.js index 5db4106f..5d488e49 100644 --- a/static/fedilove-no-react.js +++ b/static/fedilove-no-react.js @@ -26,7 +26,12 @@ const fediloveMastodon = { }, API: { discardAccount: function(account_id, cback) { - fediloveMastodon.post('/api/v1/accounts/18084/block', {}, function(data) { cback() }); + fediloveMastodon.post(`/api/v1/accounts/${account_id}/block`, {}, function(data) { cback() }); + }, + matchAccount: function(account_id, cback) { + fediloveMastodon.post(`/api/v1/accounts/${account_id}/follow`, {'reblogs': true}, + function(data) { cback() } + ); }, statusFav: function(dom, status_id) { var dislike = false; @@ -232,7 +237,16 @@ var fediloveUI = { setTimeout(function() { window.history.back() }, 220); }); }, - onAccountMatch: function() {}, + onAccountMatch: function() { + const accObj = fediloveApi.getMeetAccount(); + if (accObj === undefined) return; + if (!fediloveData.tmpDiscardedAccounts.includes(accObj.id)) + fediloveData.tmpDiscardedAccounts.push(accObj.id); + fediloveMastodon.API.matchAccount(accObj.id, function() { + $('div.virtual-list')[0].style.animation = 'yepMeet .25s linear 1'; + setTimeout(function() { window.history.back() }, 220); + }); + }, onAccountMaybe: function() {} }; @@ -449,6 +463,10 @@ function fedilove_customization() { 0% {position: relative; top: 0} 100% {position: relative; top: 95vh} } +@keyframes yepMeet { + 0% {position: relative; top: 0} + 100% {position: relative; top: -95vh} +} `; document.body.appendChild(style); } @@ -679,8 +697,6 @@ function fedilove_customization() { $('div#noone-to-meet')[0].style = ''; } - prevItems = items; - }, 200); } else if (window.location.pathname.startsWith('/notifications/mentions')) {