mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
fix(core): update and fix oxlint error (#13591)
#### PR Dependency Tree * **PR #13591** 👈 * **PR #13590** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Bug Fixes - Improved drag-and-drop stability: draggables, drop targets, and monitors now respond when option sources or external data change. - Improved async actions and permission checks to always use the latest callbacks and error handlers. - Chores - Lint/Prettier configs updated to ignore the Git directory. - Upgraded oxlint dev dependency. - Tests - Updated several end-to-end tests for more reliable text selection, focus handling, and timing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -14,12 +14,16 @@ export const useGuard = <
|
||||
) => {
|
||||
const guardService = useService(GuardService);
|
||||
useEffect(() => {
|
||||
// oxlint-disable-next-line exhaustive-deps
|
||||
guardService.revalidateCan(action, ...args);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [action, guardService, ...args]);
|
||||
|
||||
const livedata$ = useMemo(
|
||||
() => guardService.can$(action, ...args),
|
||||
() => {
|
||||
// oxlint-disable-next-line exhaustive-deps
|
||||
return guardService.can$(action, ...args);
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[action, guardService, ...args]
|
||||
);
|
||||
|
||||
@@ -24,6 +24,6 @@ export function useAsyncCallback<T extends any[]>(
|
||||
(...args: any) => {
|
||||
callback(...args).catch(e => handleAsyncError(e));
|
||||
},
|
||||
[...deps] // eslint-disable-line react-hooks/exhaustive-deps
|
||||
[callback, handleAsyncError, ...deps] // eslint-disable-line react-hooks/exhaustive-deps
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user