Skip to content

Commit

Permalink
Merge pull request #21 from glucoseinc/feature/number-of-default-show…
Browse files Browse the repository at this point in the history
…-limit

エンティティ数で表示を制限する数値のデフォルトを1に
  • Loading branch information
sasaujp authored Feb 18, 2022
2 parents 1ca55c3 + feac6e8 commit 86ce3e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions node/src/ts/visualizer/components/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const Filter: React.FC = () => {
const query = useQuery()

const defaultEntitiesLimit = useMemo(() => {
const limit = Number(query.get('lower_limit'))
const limit = Number(query.get('lower_limit')) || 1
if (Number.isInteger(limit)) {
return limit
}
return 0
return 1
}, [])

const handleClick = useCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion node/src/ts/visualizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const App: React.FC<AppProps> = (props) => {
return
}

if (lowerLimitOfClassEntities === 0) {
if (lowerLimitOfClassEntities <= 1) {
history.push({
pathname: history.location.pathname,
})
Expand Down
2 changes: 1 addition & 1 deletion node/src/ts/visualizer/reducers/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface FilterState {
}

const initialState: FilterState = {
lowerLimitOfClassEntities: 0,
lowerLimitOfClassEntities: 1,
showingConditions: false,
}

Expand Down

0 comments on commit 86ce3e3

Please sign in to comment.