Fixed race condition where $ (jquery) was not loaded before fedilove.js
* Also fixed messages replacing #FediLove was removing too much text
This commit is contained in:
parent
7f5af52e20
commit
bc5fd8eb4e
|
@ -3,7 +3,7 @@ import { massageStatusPlainText } from './massageStatusPlainText'
|
|||
|
||||
export function massageUserText (text, emojis, $autoplayGifs) {
|
||||
text = text || ''
|
||||
text = text.replace(/<a[^<>]+>.*?#.*?>fedilove<.*?<\/a>/gi, '');
|
||||
text = text.replace(/<a[^<>]+hashtag[^<>]+>.*?#.*?>fedilove<.*?<\/a>/gi, '');
|
||||
text = emojifyText(text, emojis, $autoplayGifs)
|
||||
text = massageStatusPlainText(text)
|
||||
return text
|
||||
|
|
|
@ -607,6 +607,10 @@ function fedilove_customization() {
|
|||
// and dispatch a call to "fedilove_customization" to load page customizations depending on URL context
|
||||
var __window_url = null;
|
||||
var __window_url_old = null;
|
||||
(function() {
|
||||
const _this = setInterval(function() {
|
||||
if (typeof $ !== "undefined") {
|
||||
clearInterval(_this);
|
||||
setInterval(function() {
|
||||
const newurl = window.location.pathname;
|
||||
if (newurl != __window_url) {
|
||||
|
@ -615,4 +619,6 @@ setInterval(function() {
|
|||
fedilove_customization();
|
||||
}
|
||||
}, 100);
|
||||
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue