Fix status flapping

dumb fix for dumb bug
This commit is contained in:
Natsumi
2021-06-10 16:48:32 +12:00
parent 91a0432cf7
commit e7d28a6d03

View File

@@ -1183,6 +1183,12 @@ speechSynthesis.getVoices();
json.$online_for = API.currentUser.$online_for;
json.$offline_for = API.currentUser.$offline_for;
}
if (typeof json.statusDescription !== 'undefined') {
json.statusDescription = $app.replaceBioSymbols(json.statusDescription);
}
if (typeof json.bio !== 'undefined') {
json.bio = $app.replaceBioSymbols(json.bio);
}
if (typeof ref === 'undefined') {
ref = {
id: '',
@@ -12710,6 +12716,46 @@ speechSynthesis.getVoices();
}
});
$app.methods.replaceBioSymbols = function (text) {
if (!text) {
return;
}
var symbolList = {
'@': '',
'#': '',
'$': '',
'%': '',
'&': '',
'=': '',
'+': '',
'/': '',
'\\': '',
';': ';',
':': '˸',
',': '',
'?': '',
'!': 'ǃ',
'"': '',
'<': '≺',
'>': '≻',
'.': '',
'^': '',
'{': '',
'}': '',
'[': '',
']': '',
'(': '',
')': '',
'|': '',
'*': ''
};
for (var key in symbolList) {
var regex = new RegExp(symbolList[key], "g");
text = text.replace(regex, key);
}
return text;
};
$app = new Vue($app);
window.$app = $app;
}());