Fixed the refresh bug

This commit is contained in:
Hein
2025-10-30 14:53:42 +02:00
parent 0ba8dca0b4
commit abcf08f98e
4 changed files with 18 additions and 16 deletions

View File

@@ -19,13 +19,12 @@ export interface GlidlerAPIAdaptorForGoLangv2Props<T = unknown> extends APIOptio
}
function _GlidlerAPIAdaptorForGoLangv2<T = unknown>(props: GlidlerAPIAdaptorForGoLangv2Props<T>) {
const [setStateFN, setState, getState, addError, mounted, loadPage] = useGridlerStore((s) => [
const [setStateFN, setState, getState, addError, mounted] = useGridlerStore((s) => [
s.setStateFN,
s.setState,
s.getState,
s.addError,
s.mounted,
s.loadPage,
]);
const useAPIQuery: (index: number) => Promise<any> = useCallback(
@@ -266,8 +265,10 @@ function _GlidlerAPIAdaptorForGoLangv2<T = unknown>(props: GlidlerAPIAdaptorForG
setState('useAPIQuery', useAPIQuery);
setState('askAPIRowNumber', askAPIRowNumber);
const _refresh = getState('_refresh');
//Reset the loaded pages to new rules
loadPage(0, 'all').then(() => {
_refresh?.().then(() => {
const onChange = getState('onChange');
const getGridSelectedRows = getState('getGridSelectedRows');
if (onChange && typeof onChange === 'function') {