Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
update: 增加一些必要的注释
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Oct 8, 2023
1 parent eb2db6c commit b50bfd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/home/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export default function DashboardLayout({
// 从 SSEContext 中获取侧边栏状态及其 setter 函数
const { isNavCollapsed } = useSSEContext();

// 避免页面初始化时侧边栏闪烁的问题
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
}, []);

if (!mounted) {
return null;
}
Expand Down
1 change: 1 addition & 0 deletions app/home/utils/fixedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const FixedButton = () => {
const switchMode = (theme: string) => {
setTheme(theme);
};
// 避免按钮闪烁的问题
useEffect(() => {
setMounted(true);
}, []);
Expand Down

0 comments on commit b50bfd3

Please sign in to comment.