-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
Bug Fix - Tab Crashes when page limit exceeds a certain amout (e.g. 10000) on explore community tab. #2109
base: dev
Are you sure you want to change the base?
Bug Fix - Tab Crashes when page limit exceeds a certain amout (e.g. 10000) on explore community tab. #2109
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ import { getMxIdServer } from '../../../utils/matrix'; | |
import { stopPropagation } from '../../../utils/keyboard'; | ||
import { ScreenSize, useScreenSizeContext } from '../../../hooks/useScreenSize'; | ||
import { BackRouteHandler } from '../../../components/BackRouteHandler'; | ||
// import { LimitWarning } from './LimitWarning'; | ||
|
||
const useServerSearchParams = (searchParams: URLSearchParams): ExploreServerPathSearchParams => | ||
useMemo( | ||
|
@@ -260,6 +261,7 @@ function LimitButton({ limit, onLimitChange }: LimitButtonProps) { | |
if (!limitInput) return; | ||
const newLimit = limitInput.value.trim(); | ||
if (!newLimit) return; | ||
// my work here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here as well |
||
onLimitChange(newLimit); | ||
}; | ||
|
||
|
@@ -299,17 +301,27 @@ function LimitButton({ limit, onLimitChange }: LimitButtonProps) { | |
<Chip variant="SurfaceVariant" onClick={() => setLimit('96')} radii="Pill"> | ||
<Text size="T200">96</Text> | ||
</Chip> | ||
<Chip variant="SurfaceVariant" onClick={() => setLimit('10000')} radii="Pill"> | ||
<Text size="T200">Max</Text> | ||
</Chip> | ||
Comment on lines
+304
to
+306
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It won't be a good idea to show this option considering that the performance will be poor. |
||
</Box> | ||
</Box> | ||
<Box as="form" onSubmit={handleLimitSubmit} direction="Column" gap="300"> | ||
<Box direction="Column" gap="100"> | ||
<Text size="L400">Custom Limit</Text> | ||
<Input | ||
placeholder="Max limit- 10000" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that placeholder is misleading and not required as input already has a label |
||
name="limitInput" | ||
size="300" | ||
variant="Background" | ||
defaultValue={limit} | ||
min={1} | ||
max={10000} | ||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { | ||
if (parseInt(e.target.value) > 10000) { | ||
e.target.value = e.target.value.slice(0, 4); | ||
} | ||
}} | ||
Comment on lines
+320
to
+324
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove the |
||
step={1} | ||
outlined | ||
type="number" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the commented code