fix: hot reload bugs

This commit is contained in:
David Ralph
2021-08-17 17:09:54 +01:00
parent 54e7a3a33f
commit 6ec57c75d4
10 changed files with 61 additions and 40 deletions

View File

@@ -211,6 +211,13 @@ export default class Quote extends PureComponent {
element.style.display = 'block';
this.init();
// buttons hot reload
this.setState({
favourited: this.useFavourite(),
tweet: (localStorage.getItem('tweetButton') === 'false') ? null : this.buttons.tweet,
copy: (localStorage.getItem('copyButton') === 'false') ? null : this.buttons.copy
});
}
// uninstall quote pack reverts the quote to what you had previously