feat: delete NEXT_PUBLIC_ENABLE_BLOCKAD

This commit is contained in:
shinya
2025-07-02 10:12:54 +08:00
parent 4a93ea2800
commit 87b65fc7b4
2 changed files with 4 additions and 5 deletions

View File

@@ -123,13 +123,13 @@ function PlayPageClient() {
// 上次使用的音量,默认 0.7
const lastVolumeRef = useRef<number>(0.7);
// 新增:去广告开关(从 localStorage 继承,默认取环境变量
// 新增:去广告开关(从 localStorage 继承,默认 true
const [blockAdEnabled, _setBlockAdEnabled] = useState<boolean>(() => {
if (typeof window !== 'undefined') {
const v = localStorage.getItem('enable_blockad');
if (v !== null) return v === 'true';
}
return process.env.NEXT_PUBLIC_ENABLE_BLOCKAD === 'true';
return true;
});
// 同步最新值到 refs