Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint 39 #2726

Merged
merged 47 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
acf38c7
CW-image-gallery-resize Fix wrong flag
MeyerPV Jul 10, 2024
7f22e1c
CW-performance-monitoring Added firebase performance monitoring
MeyerPV Jul 10, 2024
454eb11
CW-performance-monitoring Fix tests
MeyerPV Jul 10, 2024
a50e2d5
Merge pull request #2715 from daostack/CW-image-gallery-resize
MeyerPV Jul 11, 2024
5ac183a
CW-performance-monitoring added try/catch
MeyerPV Jul 11, 2024
f085b2b
Merge pull request #2716 from daostack/CW-performance-monitoring
MeyerPV Jul 11, 2024
9db2521
CW-crash-backpage Added condition for empty joinedAt
MeyerPV Jul 16, 2024
5e63d16
CW-long-breadcrumbs Added tooltip logic
MeyerPV Jul 30, 2024
cfff514
CW-crash-backpage added more conditions for joinedAt
MeyerPV Jul 31, 2024
e5cfcff
Merge pull request #2717 from daostack/CW-crash-backpage
MeyerPV Jul 31, 2024
a6577d8
CW-some-stream-disappear Optimized FeedItem component. FIxed conditio…
MeyerPV Aug 1, 2024
df78493
CW-long-breadcrumbs Fixed open menu
MeyerPV Aug 4, 2024
09e5723
CW-long-breadcrumbs Added margin-left to my spaces icon
MeyerPV Aug 4, 2024
84cf027
Merge pull request #2718 from daostack/CW-long-breadcrumbs
MeyerPV Aug 5, 2024
0e0bde0
CW-some-stream-disappear Fixed Render fewer hooks issue
MeyerPV Aug 5, 2024
c14a3be
CW-some-stream-disappear Added names to components for better debugging
MeyerPV Aug 6, 2024
9facea7
chat dark mode colors fix
elatif2020 Aug 6, 2024
2e77e09
join project form dark mode colors fix
elatif2020 Aug 6, 2024
2916c3d
Merge pull request #2720 from daostack/Chat-palette-fixings-in-dark-mode
MeyerPV Aug 6, 2024
b90ebbf
CW-some-stream-disappear Added commonId related logic for Feed
MeyerPV Aug 7, 2024
e0e046c
CW-mobile-performance Added memoization for ProjectFeedItem
MeyerPV Aug 8, 2024
795445b
CW-mobile-performance Added memoization for FeedCard
MeyerPV Aug 8, 2024
66c84cf
CW-mobile-performance Added useMemo for lastMessages and menuItems
MeyerPV Aug 8, 2024
5c9a860
CW-mobile-performance Added memo for CommonFeed
MeyerPV Aug 8, 2024
c6cbf9d
CW-mobile-performance Fix type issue
MeyerPV Aug 8, 2024
5e0d1c5
CW-mobile-performance Optimize FeedLayout
MeyerPV Aug 8, 2024
c38e291
CW-mobile-performance Added memo for TreeItemTrigger and useMenuItems
MeyerPV Aug 8, 2024
a5d19af
CW-mobile-performance Fix TreeItemTrigger component
MeyerPV Aug 9, 2024
fb6414d
CW-mobile-performance Optimize components
MeyerPV Aug 9, 2024
51142e5
CW-mobile-perfromance Remove unnecessary libraries
MeyerPV Aug 12, 2024
d7792d4
CW-mobile-performance Fix jest config
MeyerPV Aug 12, 2024
d9aa6e8
CW-mobile-performance Fix words func call
MeyerPV Aug 12, 2024
9fecc76
CW-mobile-performance Fix eslint
MeyerPV Aug 12, 2024
8b4d4af
CW-mobile-performance Added lodash-es types
MeyerPV Aug 12, 2024
dbcf4b6
Revert "CW-mobile-performance Added lodash-es types"
MeyerPV Aug 12, 2024
218e362
Revert "CW-mobile-performance Fix eslint"
MeyerPV Aug 12, 2024
5813f1b
Revert "CW-mobile-performance Fix words func call"
MeyerPV Aug 12, 2024
9d245d0
Revert "CW-mobile-performance Fix jest config"
MeyerPV Aug 12, 2024
2be85e8
Revert "CW-mobile-perfromance Remove unnecessary libraries"
MeyerPV Aug 12, 2024
7afe4cd
CW-mobile-performance fixed new stream issue
MeyerPV Aug 19, 2024
d4d5306
Merge pull request #2721 from daostack/CW-mobile-performance
MeyerPV Aug 26, 2024
7bc0954
Merge branch 'dev' into CW-some-stream-disappear
MeyerPV Aug 26, 2024
c4a2fb7
Merge pull request #2719 from daostack/CW-some-stream-disappear
MeyerPV Aug 27, 2024
567554a
Merge pull request #2725 from daostack/dev
MeyerPV Aug 27, 2024
14132c4
CW-fix-tree-icons Added condition for empty Tree spaces icons
MeyerPV Aug 28, 2024
d70ebb3
Merge pull request #2727 from daostack/CW-fix-tree-icons
MeyerPV Aug 28, 2024
3e2ea1f
Merge pull request #2728 from daostack/dev
MeyerPV Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"jest-extended": "^2.0.0",
"jest-fetch-mock": "^3.0.3",
"lint-staged": ">=10",
"prettier": "^2.1.1",
"prop-types": "^15.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ const CommonMember: FC<CommonMemberProps> = ({
</div>
</div>
</div>
<div className="members__section__common-member-date">
{joinedAt
.toDate()
.toLocaleDateString("en-US", { month: "short", day: "numeric" })}
</div>
{joinedAt && joinedAt.toDate && (
<div className="members__section__common-member-date">
{joinedAt
?.toDate()
.toLocaleDateString("en-US", { month: "short", day: "numeric" })}
</div>
)}
<MemberDropdown
notMemberCircles={notMemberCircles}
memberName={memberName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const MembersComponent: FC<MembersComponentProps> = ({ common }) => {
() =>
[...commonMembers].sort(
(commonMember, prevCommonMember) =>
prevCommonMember.joinedAt.seconds - commonMember.joinedAt.seconds,
prevCommonMember.joinedAt?.seconds - commonMember.joinedAt?.seconds,
),
[commonMembers],
);
Expand Down
3 changes: 2 additions & 1 deletion src/pages/OldCommon/hooks/useCommonMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const useCommonMember = (options: Options = {}): Return => {
loading: false,
fetched: true,
data: {
commonId,
...commonMember,
...generateCirclesDataForCommonMember(
governance.circles,
Expand Down Expand Up @@ -189,7 +190,7 @@ export const useCommonMember = (options: Options = {}): Return => {
}
}
},
[state, userId],
[state, userId, commonId],
);

const setCommonMember = useCallback(
Expand Down
12 changes: 9 additions & 3 deletions src/pages/OldCommon/hooks/useCommonMembers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useCallback, useRef, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { trace } from "firebase/performance";
import { CommonService, Logger, UserService } from "@/services";
import { store } from "@/shared/appConfig";
import { LoadingState } from "@/shared/interfaces";
Expand All @@ -10,6 +11,7 @@ import {
selectUserStates,
} from "@/store/states";
import { useDeepCompareEffect } from "react-use";
import { perf } from "@/shared/utils/firebase";

interface Options {
commonId?: string;
Expand Down Expand Up @@ -111,6 +113,9 @@ export const useCommonMembers = ({ commonId }: Options): Return => {

(async () => {
try {
const useCommonMembersTrace = trace(perf, 'useCommonMembers');
useCommonMembersTrace.start();

const cachedUserStates = selectUserStates()(store.getState());
const hasUsersFromCache = commonMembers.some(
({ userId }) => cachedUserStates[userId]?.data,
Expand All @@ -136,7 +141,7 @@ export const useCommonMembers = ({ commonId }: Options): Return => {

const user = cachedUserStates[commonMember.userId]?.data;

return user ? [...acc, { ...commonMember, user }] : acc;
return user ? [...acc, { ...commonMember, user, commonId }] : acc;
}, []);

return {
Expand Down Expand Up @@ -173,7 +178,7 @@ export const useCommonMembers = ({ commonId }: Options): Return => {
({ uid }) => uid === commonMember.userId,
);

return user ? [...acc, { ...commonMember, user }] : acc;
return user ? [...acc, { ...commonMember, user, commonId }] : acc;
}, []);

return {
Expand All @@ -183,6 +188,7 @@ export const useCommonMembers = ({ commonId }: Options): Return => {
};
});
dispatch(cacheActions.updateUserStates(fetchedUsers));
useCommonMembersTrace.stop();
} catch (err) {
Logger.error(err);
setState((prevState) => ({
Expand All @@ -192,7 +198,7 @@ export const useCommonMembers = ({ commonId }: Options): Return => {
}));
}
})();
}, [commonMembersState.data]);
}, [commonMembersState.data, commonId]);

return {
...state,
Expand Down
13 changes: 9 additions & 4 deletions src/pages/common/components/ChatComponent/ChatComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,15 @@ export default function ChatComponent({
chatChannelId: chatChannel?.id || "",
participants: chatChannel?.participants,
});
const users = chatChannel ? chatUsers : discussionUsers;
const discussionMessages = chatChannel
? chatMessagesData.data
: discussionMessagesData.data || [];
const users = useMemo(
() => (chatChannel ? chatUsers : discussionUsers),
[chatUsers, discussionUsers, chatChannel],
);
const discussionMessages = useMemo(
() =>
chatChannel ? chatMessagesData.data : discussionMessagesData.data || [],
[chatChannel, chatMessagesData.data, discussionMessagesData.data],
);
const isFetchedDiscussionMessages =
discussionMessagesData.fetched || chatMessagesData.fetched;
const areInitialMessagesLoading = isChatChannel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const MembersComponent: FC<MembersComponentProps> = (props) => {
() =>
[...commonMembers].sort(
(commonMember, prevCommonMember) =>
prevCommonMember.joinedAt.seconds - commonMember.joinedAt.seconds,
prevCommonMember.joinedAt?.seconds - commonMember.joinedAt?.seconds,
),
[commonMembers],
);
Expand Down
Loading
Loading