Skip to content

Commit

Permalink
refactor: modify the parameter type of access function (ant-design#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zqran authored Feb 14, 2022
1 parent 86b7c87 commit f1c9c38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/access.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @see https://umijs.org/zh-CN/plugins/plugin-access
* */
export default function access(initialState: { currentUser?: API.CurrentUser | undefined }) {
const { currentUser } = initialState || {};
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
const { currentUser } = initialState ?? {};
return {
canAdmin: currentUser && currentUser.access === 'admin',
};
Expand Down

0 comments on commit f1c9c38

Please sign in to comment.