Skip to content

Commit 580abd8

Browse files
committed
refactor(collection): simplify null check with optional chaining
1 parent 86a14f1 commit 580abd8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pages/CollectionPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ export const Collection: React.FC = () => {
386386
* 处理打开管理游戏对话框
387387
*/
388388
const handleOpenManageGamesDialog = async () => {
389-
if (!selectedItem || selectedItem.type !== "category") return;
389+
if (selectedItem?.type !== "category") return;
390390

391391
setMenuPosition(null); // 关闭右键菜单
392392

0 commit comments

Comments
 (0)