Fix emoji error in profile title when hidden

This commit is contained in:
idotj 2024-02-08 16:10:44 +01:00
parent c118544555
commit e12f7b6c05
3 changed files with 39 additions and 23 deletions

File diff suppressed because one or more lines are too long

View File

@ -52,7 +52,7 @@ class MastodonTimeline {
* Initialize and build the timeline * Initialize and build the timeline
*/ */
mtInit() { mtInit() {
console.log("Init Mastodon timeline. Settings: ", this.mtSettings); // console.log("Init Mastodon timeline. Settings: ", this.mtSettings);
this.#loadColorTheme(); this.#loadColorTheme();
this.#buildTimeline("newTimeline"); this.#buildTimeline("newTimeline");
} }
@ -186,7 +186,7 @@ class MastodonTimeline {
return { ...result, ...dataItem }; return { ...result, ...dataItem };
}, {}); }, {});
console.log("Timeline data fetched: ", this.mtSettings.fetchedData); // console.log("Timeline data fetched: ", this.mtSettings.fetchedData);
resolve(); resolve();
}); });
}); });
@ -311,12 +311,15 @@ class MastodonTimeline {
"</a>"; "</a>";
// User name and url // User name and url
userName = this.#createEmoji( userName = c.reblog.account.display_name
c.reblog.account.display_name
? c.reblog.account.display_name ? c.reblog.account.display_name
: c.reblog.account.username, : c.reblog.account.username;
if (!this.mtSettings.hideEmojos) {
userName = this.#createEmoji(
userName,
this.mtSettings.fetchedData.emojos this.mtSettings.fetchedData.emojos
); );
}
user = user =
'<div class="mt-post-header-user">' + '<div class="mt-post-header-user">' +
'<a href="' + '<a href="' +
@ -356,10 +359,15 @@ class MastodonTimeline {
"</a>"; "</a>";
// User name and url // User name and url
userName = c.account.display_name
? c.account.display_name
: c.account.username;
if (!this.mtSettings.hideEmojos) {
userName = this.#createEmoji( userName = this.#createEmoji(
c.account.display_name ? c.account.display_name : c.account.username, userName,
this.mtSettings.fetchedData.emojos this.mtSettings.fetchedData.emojos
); );
}
user = user =
'<div class="mt-post-header-user">' + '<div class="mt-post-header-user">' +
'<a href="' + '<a href="' +

View File

@ -311,12 +311,15 @@ class MastodonTimeline {
"</a>"; "</a>";
// User name and url // User name and url
userName = this.#createEmoji( userName = c.reblog.account.display_name
c.reblog.account.display_name
? c.reblog.account.display_name ? c.reblog.account.display_name
: c.reblog.account.username, : c.reblog.account.username;
if (!this.mtSettings.hideEmojos) {
userName = this.#createEmoji(
userName,
this.mtSettings.fetchedData.emojos this.mtSettings.fetchedData.emojos
); );
}
user = user =
'<div class="mt-post-header-user">' + '<div class="mt-post-header-user">' +
'<a href="' + '<a href="' +
@ -356,10 +359,15 @@ class MastodonTimeline {
"</a>"; "</a>";
// User name and url // User name and url
userName = c.account.display_name
? c.account.display_name
: c.account.username;
if (!this.mtSettings.hideEmojos) {
userName = this.#createEmoji( userName = this.#createEmoji(
c.account.display_name ? c.account.display_name : c.account.username, userName,
this.mtSettings.fetchedData.emojos this.mtSettings.fetchedData.emojos
); );
}
user = user =
'<div class="mt-post-header-user">' + '<div class="mt-post-header-user">' +
'<a href="' + '<a href="' +