Skip to content

Commit d9aedf2

Browse files
authored
feat: constantly sending collaboration messages (#1769)
1 parent 66604b7 commit d9aedf2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

apps/nextjs-app/src/features/app/blocks/view/grid/hooks/useCollaborate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export const useCollaborate = (
9191
}
9292
);
9393
}
94-
}, [activeCell, localPresence, tableId, user, getCellContent]);
94+
// not include getCellContent, because it will be changed frequently
95+
// eslint-disable-next-line react-hooks/exhaustive-deps
96+
}, [activeCell, localPresence, tableId, user]);
9597

9698
return collaborators;
9799
};

packages/sdk/src/hooks/use-button-click-status.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getTableButtonClickChannel } from '@teable/core';
33
import { buttonClick as buttonClickApi } from '@teable/openapi/src/record/button-click';
44
import { sonner } from '@teable/ui-lib';
55
import { isEmpty, get } from 'lodash';
6-
import { useCallback, useEffect, useRef, useState } from 'react';
6+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
77
import { useTranslation } from '../context/app/i18n';
88
import { useConnection } from './use-connection';
99

@@ -122,7 +122,9 @@ export const useButtonClickStatus = (tableId: string) => {
122122
};
123123
}, [connection, presence, channel, setStatus]);
124124

125-
return { checkLoading, setStatus, buttonClick };
125+
return useMemo(() => {
126+
return { checkLoading, setStatus, buttonClick };
127+
}, [checkLoading, setStatus, buttonClick]);
126128
};
127129

128130
export type IButtonClickStatusHook = ReturnType<typeof useButtonClickStatus>;

0 commit comments

Comments
 (0)