Skip to content

Commit

Permalink
prevent unnecessary config app view
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyos committed Jun 29, 2023
1 parent 5c85a69 commit 6d75b35
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"react-router-dom": "^6.8.2",
"recoil": "^0.7.7",
"swiper": "^9.1.0",
"zmp-sdk": "^2.27.1",
"zmp-sdk": "^2.27.2",
"zmp-ui": "^1.6.0-rc.6"
},
"devDependencies": {
Expand Down
9 changes: 7 additions & 2 deletions src/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { useEffect, useState } from "react";
import { useEffect, useRef, useState } from "react";
import { matchStatusBarColor } from "utils/device";
import { useSnackbar } from "zmp-ui";

export function useMatchStatusTextColor(visible?: boolean) {
const changedRef = useRef(false);
useEffect(() => {
matchStatusBarColor(visible ?? false);
if (changedRef.current) {
matchStatusBarColor(visible ?? false);
} else {
changedRef.current = true;
}
}, [visible]);
}

Expand Down

0 comments on commit 6d75b35

Please sign in to comment.