Skip to content

Commit

Permalink
Merge pull request #2747 from daostack/CW-fix-confliсе
Browse files Browse the repository at this point in the history
Fix merge conflict
  • Loading branch information
MeyerPV authored Oct 15, 2024
2 parents 5e01307 + 6ed41ac commit 440575f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 27 deletions.
6 changes: 0 additions & 6 deletions src/pages/OldCommon/hooks/useCommonMembers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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 @@ -11,7 +10,6 @@ import {
selectUserStates,
} from "@/store/states";
import { useDeepCompareEffect } from "react-use";
import { perf } from "@/shared/utils/firebase";

interface Options {
commonId?: string;
Expand Down Expand Up @@ -113,9 +111,6 @@ 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 Down Expand Up @@ -188,7 +183,6 @@ export const useCommonMembers = ({ commonId }: Options): Return => {
};
});
dispatch(cacheActions.updateUserStates(fetchedUsers));
useCommonMembersTrace.stop();
} catch (err) {
Logger.error(err);
setState((prevState) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PrivacyPolicy/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./PrivacyPolicy";
export * from "./PrivacyPolicy";
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ interface ProjectProps {
}

const Project: FC<ProjectProps> = (props) => {
const {
title,
url,
imageURL,
imageAlt,
tooltipContent,
} = props;
const { title, url, imageURL, imageAlt, tooltipContent } = props;

const contentEl = (
<div className={styles.item}>
Expand Down
15 changes: 3 additions & 12 deletions src/shared/hooks/useCases/useDiscussionMessagesById.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useState, useCallback, useEffect, useRef } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useDeepCompareEffect, useUpdateEffect } from "react-use";
import { trace } from "firebase/performance";
import {
DiscussionMessageService,
MESSAGES_NUMBER_IN_BATCH,
Expand All @@ -21,7 +20,7 @@ import {
User,
} from "@/shared/models";
import { InternalLinkData } from "@/shared/utils";
import firebase, { perf } from "@/shared/utils/firebase";
import firebase from "@/shared/utils/firebase";
import {
cacheActions,
selectDiscussionMessagesStateByDiscussionId,
Expand Down Expand Up @@ -156,10 +155,7 @@ export const useDiscussionMessagesById = ({

const fetchRepliedMessages = useCallback(
async (messageId: string, endDate: Date): Promise<void> => {
const fetchRepliedMessagesTrace = trace(perf, 'fetchRepliedMessagesTrace');
try {
fetchRepliedMessagesTrace.start();

if (state.data?.find((item) => item.id === messageId)) {
return Promise.resolve();
}
Expand Down Expand Up @@ -213,9 +209,8 @@ export const useDiscussionMessagesById = ({
updatedDiscussionMessages: discussionsWithText,
}),
);
fetchRepliedMessagesTrace.stop();
} catch(err) {
fetchRepliedMessagesTrace.stop();
// console.log(err);
}
},
[
Expand Down Expand Up @@ -250,9 +245,6 @@ export const useDiscussionMessagesById = ({
}

try {
const fetchDiscussionMessagesTrace = trace(perf, 'fetchDiscussionMessages');
fetchDiscussionMessagesTrace.start();

unsubscribeRef.current = DiscussionMessageService.subscribeToDiscussionMessagesByDiscussionId(
discussionId,
lastVisible && lastVisible[discussionId],
Expand Down Expand Up @@ -322,8 +314,7 @@ export const useDiscussionMessagesById = ({
setIsBatchLoading(false);
},
);
fetchDiscussionMessagesTrace.stop();
} catch (err) {
} catch(err) {
setIsBatchLoading(false);
}
}, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const FeedItemBreadcrumbs: FC<FeedItemBreadcrumbsProps> = ({
});

return () => {
unsubscribe();
unsubscribe && unsubscribe();
};
}, [breadcrumbs.activeItem?.id]);

Expand Down

0 comments on commit 440575f

Please sign in to comment.