mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +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:
@@ -84,7 +84,7 @@ export const useDraggable = <D extends DNDData = DNDData>(
|
||||
: undefined,
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [...deps, context.toExternalData]);
|
||||
}, [...deps, getOptions, context.toExternalData]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
|
||||
@@ -207,7 +207,7 @@ export const useDropTarget = <D extends DNDData = DNDData>(
|
||||
: undefined,
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [...deps, dropTargetContext.fromExternalData]);
|
||||
}, [...deps, getOptions, dropTargetContext.fromExternalData]);
|
||||
|
||||
const getDropTargetOptions = useCallback(() => {
|
||||
const wrappedCanDrop = dropTargetGet(options.canDrop, options);
|
||||
|
||||
@@ -95,7 +95,7 @@ export const useDndMonitor = <D extends DNDData = DNDData>(
|
||||
: undefined,
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [...deps, getOptions]);
|
||||
}, [...deps, getOptions, dropTargetContext.fromExternalData]);
|
||||
|
||||
const monitorOptions = useMemo(() => {
|
||||
return {
|
||||
|
||||
@@ -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