mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Fix regression: threadify stopped working
This is due to status key changed with extra instance string
This commit is contained in:
parent
be35f3a415
commit
5c6c9a43f2
2 changed files with 7 additions and 5 deletions
|
@ -294,12 +294,12 @@ function Status({
|
|||
{!withinContext && (
|
||||
<>
|
||||
{inReplyToAccountId === status.account?.id ||
|
||||
!!snapStates.statusThreadNumber[id] ? (
|
||||
!!snapStates.statusThreadNumber[sKey] ? (
|
||||
<div class="status-thread-badge">
|
||||
<Icon icon="thread" size="s" />
|
||||
Thread
|
||||
{snapStates.statusThreadNumber[id]
|
||||
? ` ${snapStates.statusThreadNumber[id]}/X`
|
||||
{snapStates.statusThreadNumber[sKey]
|
||||
? ` ${snapStates.statusThreadNumber[sKey]}/X`
|
||||
: ''}
|
||||
</div>
|
||||
) : (
|
||||
|
|
|
@ -124,7 +124,8 @@ export function threadifyStatus(status, propInstance) {
|
|||
throw 'Not a thread';
|
||||
// Possibly thread of replies by multiple people?
|
||||
}
|
||||
let prevStatus = states.statuses[inReplyToId];
|
||||
const key = statusKey(inReplyToId, instance);
|
||||
let prevStatus = states.statuses[key];
|
||||
if (!prevStatus) {
|
||||
if (fetchIndex++ > 3) throw 'Too many fetches for thread'; // Some people revive old threads
|
||||
await new Promise((r) => setTimeout(r, 500 * fetchIndex)); // Be nice to rate limits
|
||||
|
@ -139,7 +140,8 @@ export function threadifyStatus(status, propInstance) {
|
|||
if (statuses.length > 1) {
|
||||
console.debug('THREAD', statuses);
|
||||
statuses.forEach((status, index) => {
|
||||
states.statusThreadNumber[status.id] = index + 1;
|
||||
const key = statusKey(status.id, instance);
|
||||
states.statusThreadNumber[key] = index + 1;
|
||||
});
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue