Skip to content

Commit

Permalink
hotfix - useful button display and typings
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Mar 1, 2021
1 parent 06523ce commit 6317443
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class HowtoDescription extends React.PureComponent<IProps> {
</Button>
</Link>
<Box style={{ flexGrow: 1 }}>
{this.props.votedUsefulCount && (
{this.props.votedUsefulCount !== undefined && (
<HowtoUsefulStats
votedUsefulCount={this.props.votedUsefulCount}
userVotedUseful={this.props.userVotedUseful}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import * as React from 'react'
import { useHistory } from 'react-router'
import { Flex } from 'rebass'
import { FaStar, FaRegStar } from 'react-icons/fa'
import Text from 'src/components/Text'
import { Button } from 'src/components/Button'
import Tooltip from 'src/components/Tooltip'
Expand Down Expand Up @@ -36,6 +34,7 @@ export const HowtoUsefulStats = (props: IProps) => {
return (
<>
<Button
data-cy="vote-useful"
data-tip={props.isLoggedIn ? undefined : 'log in to use this'}
variant="subtle"
fontSize="14px"
Expand Down
3 changes: 1 addition & 2 deletions src/stores/Howto/howto.store.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { observable, action, computed, toJS, makeObservable } from 'mobx'
import { Subscription } from 'rxjs'
import Fuse from 'fuse.js'
import {
IHowto,
Expand Down Expand Up @@ -75,7 +74,7 @@ export class HowtoStore extends ModuleStore {
.doc(`${id}/stats/all`)
const howtoStats = await ref.get('server')
console.log('howtoStats', howtoStats)
this.howtoStats = howtoStats
this.howtoStats = howtoStats || { votedUsefulCount: 0 }
}
}
@action
Expand Down

0 comments on commit 6317443

Please sign in to comment.