Permalink
Browse files

Clear data when logging out

  • Loading branch information...
dusty-phillips committed Aug 27, 2018
1 parent b9a22cd commit d64a3381116077d4529e80823a1d35034d201ba8
Showing with 16 additions and 6 deletions.
  1. +16 −6 src/components/AuthButton.js
@@ -29,19 +29,29 @@ class AuthButton extends Component {
</div>
)
}
return <button
style={{ width: "20rem" }}
onClick={() => this.props.firebase.logout()}
> Logout</button >
return (
<button
style={{ width: "20rem" }}
onClick={async () => {
await this.props.firebase.logout()
this.props.clearFirestore()
}}
>
Logout
</button >
)
}
}
const mapStateToProps = state => {
return { auth: state.firebase.auth }
}
const mapDispatchToProps = {
const mapDispatchToProps = dispatch => {
return {
clearFirestore: () => dispatch({ type: '@@reduxFirestore/CLEAR_DATA' })
}
}

0 comments on commit d64a338

Please sign in to comment.