From 5944b4fe30559ac943c2755309d63506701dd0bc Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 22 Dec 2022 22:43:04 +0800 Subject: [PATCH] Don't remove status immediately It'll be too abrupt. Set `_deleted` flag for now, no UI yet. --- src/app.jsx | 4 +++- src/components/status.jsx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.jsx b/src/app.jsx index 27268c59..e86df9bc 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -56,7 +56,9 @@ async function startStream() { }); stream.on('delete', (statusID) => { console.log('DELETE', statusID); - states.statuses.delete(statusID); + // states.statuses.delete(statusID); + const s = states.statuses.get(statusID); + if (s) s._deleted = true; }); stream.on('notification', (notification) => { console.log('NOTIFICATION', notification); diff --git a/src/components/status.jsx b/src/components/status.jsx index 412cef22..231b3489 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -99,6 +99,7 @@ function Status({ reblog, uri, emojis, + _deleted, } = status; const createdAtDate = new Date(createdAt);