From 52e6735e41635aef1e746a8bdab27e3c8b0d3e29 Mon Sep 17 00:00:00 2001 From: Martina Date: Tue, 8 Dec 2020 12:11:32 -0800 Subject: [PATCH] updated language of feed events --- node_common/managers/viewer.js | 15 +++++++-------- node_common/monitor.js | 6 +++--- scenes/SceneHome.js | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/node_common/managers/viewer.js b/node_common/managers/viewer.js index 83362bb3..c5223ccc 100644 --- a/node_common/managers/viewer.js +++ b/node_common/managers/viewer.js @@ -334,12 +334,11 @@ const formatActivity = async (userActivity) => { let slateIds = []; if (activity && activity.length) { activity = activity.filter((item) => { - if (item.data.type === "OTHER_USER_CREATE_SLATE") { + if (item.data.type === "SUBSCRIBED_CREATE_SLATE") { slateIds.push(item.data.context.slate.id); } return ( - item.data.type === "OTHER_USER_CREATE_SLATE" || - item.data.type === "OTHER_USER_CREATE_SLATE_OBJECT" + item.data.type === "SUBSCRIBED_CREATE_SLATE" || item.data.type === "SUBSCRIBED_ADD_TO_SLATE" ); }); } @@ -353,7 +352,7 @@ const formatActivity = async (userActivity) => { } for (let item of activity) { - if (item.data.type === "OTHER_USER_CREATE_SLATE") { + if (item.data.type === "SUBSCRIBED_CREATE_SLATE") { let slate = slateTable[item.data.context.slate.id]; if (slate?.data?.objects?.length) { item.data.context.slate = slate; @@ -362,7 +361,7 @@ const formatActivity = async (userActivity) => { } //NOTE(martina): remove empty slates activity = activity.filter((item) => { - if (item.data.type === "OTHER_USER_CREATE_SLATE_OBJECT") return true; + if (item.data.type === "SUBSCRIBED_ADD_TO_SLATE") return true; let slate = item.data.context.slate; return slate?.data?.objects?.length; }); @@ -370,16 +369,16 @@ const formatActivity = async (userActivity) => { let counter = 0; for (let i = 0; i < activity.length; i++) { let item = activity[i]; - if (item.data.type === "OTHER_USER_CREATE_SLATE") { + if (item.data.type === "SUBSCRIBED_CREATE_SLATE") { counter += 2; - } else if (item.data.type === "OTHER_USER_CREATE_SLATE_OBJECT") { + } else if (item.data.type === "SUBSCRIBED_ADD_TO_SLATE") { counter += 1; } if (counter === 6) { counter = 0; } else if (counter > 6) { let j = i - 1; - while (activity[j].data.type !== "OTHER_USER_CREATE_SLATE_OBJECT") { + while (activity[j].data.type !== "SUBSCRIBED_ADD_TO_SLATE") { j -= 1; } let temp = activity[j]; diff --git a/node_common/monitor.js b/node_common/monitor.js index 4397458f..0b808184 100644 --- a/node_common/monitor.js +++ b/node_common/monitor.js @@ -55,7 +55,7 @@ const createSlateActivityForEachSubscriber = async ({ userId, data }) => { Data.createActivity({ userId: s.owner_user_id, data: { - type: "OTHER_USER_CREATE_SLATE", + type: "SUBSCRIBED_CREATE_SLATE", actorUserId: data.actorUserId, context: data.context, }, @@ -101,7 +101,7 @@ const createSlateObjectActivityForEachSubscriber = async ({ slateId, userId, dat Data.createActivity({ userId: s.owner_user_id, data: { - type: "OTHER_USER_CREATE_SLATE_OBJECT", + type: "SUBSCRIBED_ADD_TO_SLATE", actorUserId: data.actorUserId, context: data.context, }, @@ -120,7 +120,7 @@ const createSlateObjectActivityForEachSubscriber = async ({ slateId, userId, dat Data.createActivity({ userId: s.owner_user_id, data: { - type: "OTHER_USER_CREATE_SLATE_OBJECT", + type: "SUBSCRIBED_ADD_TO_SLATE", actorUserId: data.actorUserId, context: data.context, }, diff --git a/scenes/SceneHome.js b/scenes/SceneHome.js index 8777baae..d60c3b01 100644 --- a/scenes/SceneHome.js +++ b/scenes/SceneHome.js @@ -232,7 +232,7 @@ export default class SceneHome extends React.Component { {activity.length ? (
{activity.map((item) => { - if (item.data.type === "OTHER_USER_CREATE_SLATE") { + if (item.data.type === "SUBSCRIBED_CREATE_SLATE") { return ( ); - } else if (item.data.type === "OTHER_USER_CREATE_SLATE_OBJECT") { + } else if (item.data.type === "SUBSCRIBED_ADD_TO_SLATE") { return (