Skip to content

Commit

Permalink
Merge pull request #22 from QWYNG/play_with_hook
Browse files Browse the repository at this point in the history
isloading default is true
  • Loading branch information
QWYNG committed Apr 26, 2020
2 parents f06fc87 + 6660d20 commit e51b6e5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/useRankedStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ function fetchMyRankStatus(): Promise<RankedStatus> {

function useRankedStatus(): [RankedStatus | undefined, boolean] {
const [rankedStatus, setRankedStatus] = useState<RankedStatus | undefined>(undefined)
const [isLoading, setIsLoading] = useState(false)
const [isLoading, setIsLoading] = useState(true)

useEffect(() => {
setIsLoading(true)
fetchMyRankStatus().then(fetchedStatus => {
setRankedStatus(fetchedStatus)
setIsLoading(false)
Expand Down

0 comments on commit e51b6e5

Please sign in to comment.