Update components, redirect remote hashtag to local hashtag page

This commit is contained in:
Daniel Supernault 2020-08-05 00:26:29 -06:00
parent 714eceb3ea
commit b1fb7dcbc3
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 24 additions and 0 deletions

View file

@ -860,6 +860,18 @@ export default {
}
this.loaded = true;
this.fetchProfilePosts();
setTimeout(function() {
document.querySelectorAll('.status-comment .comment-text a').forEach(function(i, e) {
if(i.href.startsWith(window.location.origin)) {
return;
}
let tag = i.innerText;
if(tag.startsWith('#')) {
tag = tag.substr(1);
}
i.href = '/discover/tags/'+tag+'?src=rph';
});
}, 500);
}).catch(error => {
swal('Oops!', 'An error occured, please try refreshing the page.', 'error');
});

View file

@ -815,6 +815,18 @@
}
// this.fetchStories();
this.rtw();
setTimeout(function() {
document.querySelectorAll('.caption .status-content a').forEach(function(i, e) {
if(i.href.startsWith(window.location.origin)) {
return;
}
let tag = i.innerText;
if(tag.startsWith('#')) {
tag = tag.substr(1);
}
i.href = '/discover/tags/'+tag+'?src=rph';
});
}, 500);
}).catch(err => {
swal(
'Oops, something went wrong',