[UI] Prevent the header avatar from being reloaded any time deferred posts are fetched (#916)

This commit is contained in:
Cinder 2025-02-12 10:54:18 -08:00 committed by GitHub
parent 911d989b95
commit 8aa86a9350
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -196,7 +196,7 @@ module ApplicationHelper
klass = options.delete(:class)
named = options.delete(:named)
tag.a href: user_path(user), class: "simple-avatar #{klass}", data: { id: post_id, name: user.name } do
tag.a href: user_path(user), class: "simple-avatar placeholder #{klass}", data: { id: post_id, name: user.name } do
tag.span(class: "simple-avatar-button") do
concat tag.span(user.pretty_name, class: "simple-avatar-name") if named
concat tag.span(class: "simple-avatar-image", data: { name: user.name[0].capitalize })

View File

@ -9,8 +9,9 @@ Thumbnails.initialize = function () {
const replacedPosts = [];
// Avatar special case
for (const post of $(".simple-avatar")) {
for (const post of $(".simple-avatar.placeholder")) {
const $post = $(post);
$post.removeClass("placeholder");
const postID = $post.data("id");
if (!postID) continue;