about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions/streaming.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-01-26 20:07:26 +0100
committerThibaut Girka <thib@sitedethib.com>2020-01-27 16:01:06 +0100
commite36d0a98cc10575e67c526ef3cc9eeb431a1af3f (patch)
tree9e2922400bc4752a488efd97597743472f03f23c /app/javascript/flavours/glitch/actions/streaming.js
parent8a8936725ef34d16180203ce852d85c0748a8c3b (diff)
[Glitch] Add streaming API updates for announcements being modified or deleted
Port b9d74d407673a6dbdc87c3310618b22c85358c85 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/actions/streaming.js')
-rw-r--r--app/javascript/flavours/glitch/actions/streaming.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/actions/streaming.js b/app/javascript/flavours/glitch/actions/streaming.js
index 8294fbf36..2f82ea805 100644
--- a/app/javascript/flavours/glitch/actions/streaming.js
+++ b/app/javascript/flavours/glitch/actions/streaming.js
@@ -8,7 +8,12 @@ import {
 } from './timelines';
 import { updateNotifications, expandNotifications } from './notifications';
 import { updateConversations } from './conversations';
-import { fetchAnnouncements, updateAnnouncements, updateReaction as updateAnnouncementsReaction } from './announcements';
+import {
+  fetchAnnouncements,
+  updateAnnouncements,
+  updateReaction as updateAnnouncementsReaction,
+  deleteAnnouncement,
+} from './announcements';
 import { fetchFilters } from './filters';
 import { getLocale } from 'mastodon/locales';
 
@@ -51,6 +56,9 @@ export function connectTimelineStream (timelineId, path, pollingRefresh = null,
         case 'announcement.reaction':
           dispatch(updateAnnouncementsReaction(JSON.parse(data.payload)));
           break;
+        case 'announcement.delete':
+          dispatch(deleteAnnouncement(data.payload));
+          break;
         }
       },
     };