diff --git a/package-lock.json b/package-lock.json index 4dd9525..760553d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,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": { @@ -4644,9 +4644,9 @@ } }, "node_modules/zmp-sdk": { - "version": "2.27.1", - "resolved": "https://registry.npmjs.org/zmp-sdk/-/zmp-sdk-2.27.1.tgz", - "integrity": "sha512-W/YX0GzqJ4ZsAoVY5O8WlrPvFe83D9lKv3l0++o3SVmBz+2ilfoz853vWJoUcwq7EbbDaiVEW57yBQxTEu+VmA==", + "version": "2.27.2", + "resolved": "https://registry.npmjs.org/zmp-sdk/-/zmp-sdk-2.27.2.tgz", + "integrity": "sha512-8XJoMiflv2BiRzZEq4n5StPuj9Y31gUSMw1XdmKlO691tma0rPOLFfnXUWPoBlLO7alSm5yeyuSfz4vPOYQjlQ==", "dependencies": { "@babel/cli": "^7.17.6", "@sentry/browser": "^6.9.0", diff --git a/package.json b/package.json index 6e809f2..39ffa9e 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/hooks.ts b/src/hooks.ts index ef7d4a4..0d8e97f 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -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]); }