Skip to content

Commit

Permalink
Don't rely on user.url field
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Apr 2, 2018
1 parent 3fd24fd commit 03323a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/lichess/interfaces/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export interface UserFullProfile extends User {
readonly nbFollowers: number
readonly nbFollowing: number
readonly playing: string
readonly url: string
readonly count: UserGamesCount
readonly blocking?: boolean
readonly followable?: boolean
Expand Down
4 changes: 2 additions & 2 deletions src/ui/user/UserCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ export default function UserCtrl(userId: string): IUserCtrl {
}

export function isSessionUser(user: ProfileUser): user is Session {
return (<Session>user).kid !== undefined
return (<Session>user).prefs !== undefined
}

export function isFullUser(user: ProfileUser): user is UserFullProfile {
return (<UserFullProfile>user).url !== undefined
return (<UserFullProfile>user).count !== undefined
}

0 comments on commit 03323a5

Please sign in to comment.