Skip to content

Commit fd8f94e

Browse files
author
1zilc
committed
🐛 initpage: 使用空值合并操作符替代逻辑或运算
- 将 `|| true` 替换为 `?? true` 以正确处理 falsy 值如 0 或 "" - 避免因存储值为 0 被错误覆盖为 true 导致保密状态异常
1 parent 97bad2b commit fd8f94e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/renderer/containers/InitPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const InitPage = () => {
109109
// 视图配置加载完成
110110
dispatch(setViewModeAction(allStateStorage[CONST.STORAGE.VIEW_MODE] || sortInitialState.viewMode));
111111
// 保密状态加载完成
112-
dispatch(syncEyeStatusAction(allStateStorage[CONST.STORAGE.EYE_STATUS] || true));
112+
dispatch(syncEyeStatusAction(allStateStorage[CONST.STORAGE.EYE_STATUS] ?? true));
113113
/**
114114
* cache部分
115115
*/

0 commit comments

Comments
 (0)