mirror of
https://github.com/plausible/analytics.git
synced 2024-09-11 09:56:02 +03:00
Fixes React errors+crash when system theme changes on loaded dashboard (#1123)
* Fixes crash on theme change * Changelog
This commit is contained in:
parent
39287ab176
commit
645069271a
@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Fix weekly report time range plausible/analytics#951
|
||||
- Make sure embedded dashboards can run when user has blocked third-party cookies plausible/analytics#971
|
||||
- Sites listing page will paginate if the user has a lot of sites plausible/analytics#994
|
||||
- Crash when changing theme on a loaded dashboard plausible/analytics#1123
|
||||
|
||||
### Removed
|
||||
- Removes AppSignal monitoring package
|
||||
|
@ -34,7 +34,7 @@ class Countries extends React.Component {
|
||||
componentDidUpdate(prevProps) {
|
||||
if (this.props.query !== prevProps.query) {
|
||||
this.setState({loading: true, countries: null})
|
||||
this.fetchCountries().then(this.drawMap.bind(this))
|
||||
this.fetchCountries().then(this.drawMap)
|
||||
}
|
||||
|
||||
if (this.props.darkTheme !== prevProps.darkTheme) {
|
||||
@ -42,7 +42,7 @@ class Countries extends React.Component {
|
||||
document.getElementById('map-container').removeChild(document.querySelector('.datamaps-hoverover'));
|
||||
document.getElementById('map-container').removeChild(document.querySelector('.datamap'));
|
||||
}
|
||||
this.drawMap();
|
||||
this.fetchCountries().then(this.drawMap)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,6 +202,7 @@ class LineGraph extends React.Component {
|
||||
}
|
||||
|
||||
if (prevProps.darkTheme !== this.props.darkTheme) {
|
||||
this.chart.destroy();
|
||||
this.chart = this.regenerateChart();
|
||||
this.chart.update();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user