Quick fix disappearing posts bug

This commit is contained in:
Lim Chee Aun 2023-11-05 08:21:43 +08:00
parent 2c6d18bcfc
commit e5d5025299
2 changed files with 16 additions and 4 deletions

View file

@ -86,7 +86,7 @@ window.__STATES_STATS__ = () => {
setInterval(() => {
const { statuses } = states;
for (const key in statuses) {
const $post = document.querySelector(`[data-state-post-id="${key}"]`);
const $post = document.querySelector(`[data-state-post-id~="${key}"]`);
if (!$post) {
delete states.statuses[key];
}

View file

@ -253,7 +253,11 @@ function Status({
if (group) {
return (
<div class="status-group" onMouseEnter={debugHover}>
<div
data-state-post-id={sKey}
class="status-group"
onMouseEnter={debugHover}
>
<div class="status-pre-meta">
<Icon icon="group" size="l" alt="Group" />{' '}
<NameText account={status.account} instance={instance} showAvatar />
@ -270,7 +274,11 @@ function Status({
}
return (
<div class="status-reblog" onMouseEnter={debugHover}>
<div
data-state-post-id={sKey}
class="status-reblog"
onMouseEnter={debugHover}
>
<div class="status-pre-meta">
<Icon icon="rocket" size="l" />{' '}
<NameText account={status.account} instance={instance} showAvatar />{' '}
@ -2278,6 +2286,10 @@ function FilteredStatus({ status, filterInfo, instance, containerProps = {} }) {
);
const statusPeekRef = useTruncated();
const sKey =
statusKey(status.id, instance) +
' ' +
(statusKey(reblog?.id, instance) || '');
return (
<div
@ -2290,7 +2302,7 @@ function FilteredStatus({ status, filterInfo, instance, containerProps = {} }) {
}}
{...bindLongPressPeek()}
>
<article class="status filtered" tabindex="-1">
<article data-state-post-id={sKey} class="status filtered" tabindex="-1">
<b
class="status-filtered-badge clickable badge-meta"
title={filterTitleStr}