Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change LastRowRef on TableRows according to new client side filtering #4824

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/Trade/InfiniteScroll/InfiniteScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ function InfiniteScroll(props: propsIF) {

const newTxData: LimitOrderIF[] | PositionIF[] | TransactionIF[] = [];

let oldestTimeParam = getOldestTime(fetchedTransactions);
let oldestTimeParam = getOldestTime(
fetchedTransactionsRef.current || fetchedTransactions,
);

// ------------------- FETCH DATA WITH LOOP -------------------
while (addedDataCount < targetCount) {
Expand Down
23 changes: 22 additions & 1 deletion src/components/Trade/InfiniteScroll/TableRowsInfiniteScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,35 @@ function TableRowsInfiniteScroll({
return /iPad|iPhone|iPod/.test(userAgent);
};

const debugMode = false;

// // added to debug infinite scroll on monadTestnet link
// // can be removed after detecting issue
// const [debugMode, setDebugMode] = useState(false);
// const debugModeRef = useRef<boolean>();
// debugModeRef.current = debugMode;

// const [shortcutAdded, setShortcutAdded] = useState(false);

// useEffect(() => {
// document.addEventListener('keydown', (e) => {
// if (
// (e.shiftKey && e.altKey && e.key === 'j') ||
// (e.shiftKey && e.altKey && e.key === 'J')
// ) {
// setDebugMode(!debugModeRef.current);
// }
// });
// setShortcutAdded(true);
// }, [shortcutAdded == false]);

const isSmallScreen: boolean = useMediaQuery('(max-width: 768px)');

const wrapperID = tableKey ? tableKey : '';

const txSpanSelectorForScrollMethod = `#infinite_scroll_wrapper_${wrapperID} div[data-label='hidden-id'] > span`;
const txSpanSelectorForBindMethod = 'div[data-label="hidden-id"]';

const debugMode = false;
const markRows = false;
const [manualMode, setManualMode] = useState(false);
const manualModeRef = useRef<boolean>();
Expand Down
2 changes: 1 addition & 1 deletion src/components/Trade/TradeTabs/TableRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function TableRows({
observedRowRef={
idx === 0
? firstRowRef
: idx === data.length - 1
: idx === txDataToDisplay.length - 1
? lastRowRef
: undefined
}
Expand Down