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

fix #103: 修复TabBar中route为空会导致app奔溃问题 #104

Merged
merged 2 commits into from
Oct 27, 2023
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: 4 additions & 0 deletions src/pages/recommendSheets/components/body/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PluginManager from '@/core/pluginManager';
import {fontWeightConst} from '@/constants/uiConst';
import SheetBody from './sheetBody';
import useColors from '@/hooks/useColors';
import Empty from '@/components/base/empty';

export default function Body() {
const [index, setIndex] = useState(0);
Expand Down Expand Up @@ -53,6 +54,9 @@ export default function Body() {
/>
);

if (!routes?.length) {
return <Empty />;
}
return (
<TabView
lazy
Expand Down
4 changes: 4 additions & 0 deletions src/pages/topList/components/topListBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {TabBar, TabView} from 'react-native-tab-view';
import {fontWeightConst} from '@/constants/uiConst';
import BoardPanelWrapper from './boardPanelWrapper';
import useColors from '@/hooks/useColors';
import Empty from '@/components/base/empty';

export default function TopListBody() {
const routes = PluginManager.getSortedTopListsablePlugins().map(_ => ({
Expand All @@ -21,6 +22,9 @@ export default function TopListBody() {
),
[],
);
if (!routes?.length) {
return <Empty />;
}

return (
<TabView
Expand Down