Skip to content

Commit

Permalink
fix: rule size
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyruso authored and Zephyruso committed Sep 4, 2023
1 parent b5d0ef9 commit 2ff31d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ROUTES } from '~/constants'
import {
curTheme,
endpoint,
renderProxiesInSamePage,
selectedEndpoint,
useAutoSwitchTheme,
useProxies,
Expand Down Expand Up @@ -48,7 +49,9 @@ export const App = () => {
<Show when={selectedEndpoint()}>
<Route path={ROUTES.Overview} component={Overview} />
<Route path={ROUTES.Proxies} component={Proxies} />
<Route path={ROUTES.ProxyProvider} component={ProxyProvider} />
<Show when={!renderProxiesInSamePage()}>
<Route path={ROUTES.ProxyProvider} component={ProxyProvider} />
</Show>
<Route path={ROUTES.Rules} component={Rules} />
<Route path={ROUTES.Conns} component={Connections} />
<Route path={ROUTES.Log} component={Logs} />
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Rules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export default () => {
<div class="card card-bordered card-compact mb-2 bg-base-200 p-4">
<div class="break-all">
{rule.payload}
{rule.size !== -1 && ` (${rule.size})`}
{typeof rule.size === 'number' &&
rule.size !== -1 &&
` (${rule.size})`}
</div>
<div class="text-xs text-slate-500">
{rule.type} :: {rule.proxy}
Expand Down

0 comments on commit 2ff31d4

Please sign in to comment.