Skip to content

Commit

Permalink
Add typeof guard to performance variable (#986)
Browse files Browse the repository at this point in the history
* Fixes #768

* Fix comment and add changelog
  • Loading branch information
HarelM committed Feb 11, 2022
1 parent 8ff0907 commit 9d600e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Features and improvements

- Default compact attribution to be open by default to comply with OpenSteetMap Attribution Guidelines (#795)
- Export `Source` classes (`GeoJSONSource` etc.) declarations. ([#801](https://github.com/maplibre/maplibre-gl-js/issues/801))
- Export `Source` classes (`GeoJSONSource` etc.) declarations. (#801)
- Make `AJAXError` public so error HTTP responses can be handled differently from other errors.
- *...Add new stuff here...*

Expand All @@ -12,6 +12,7 @@
- Fix compact attribution button showing when attribution is blank (#795)
- Fix error mismatched image size for CJK characters (#718)
- Fire `dataabort` and `sourcedataabort` events when a tile request is aborted (#794)
- Fix NextJs `performance` undefined (#768)
- *...Add new stuff here...*

## 2.1.1
Expand Down
2 changes: 1 addition & 1 deletion src/util/browser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {Cancelable} from '../types/cancelable';

const now = performance && performance.now ?
const now = typeof performance !== 'undefined' && performance && performance.now ?
performance.now.bind(performance) :
Date.now.bind(Date);

Expand Down

0 comments on commit 9d600e6

Please sign in to comment.