updated language of feed events

This commit is contained in:
Martina 2020-12-08 12:11:32 -08:00
parent 4251e0632f
commit 52e6735e41
3 changed files with 12 additions and 13 deletions

View File

@ -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];

View File

@ -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,
},

View File

@ -232,7 +232,7 @@ export default class SceneHome extends React.Component {
{activity.length ? (
<div css={STYLES_ACTIVITY_GRID}>
{activity.map((item) => {
if (item.data.type === "OTHER_USER_CREATE_SLATE") {
if (item.data.type === "SUBSCRIBED_CREATE_SLATE") {
return (
<span
key={item.id}
@ -247,7 +247,7 @@ export default class SceneHome extends React.Component {
<ActivityRectangle size={this.state.imageSize} item={item.data.context} />
</span>
);
} else if (item.data.type === "OTHER_USER_CREATE_SLATE_OBJECT") {
} else if (item.data.type === "SUBSCRIBED_ADD_TO_SLATE") {
return (
<span
key={item.id}