Skip to content

Commit

Permalink
fix: error with user-agent brand not being an array (#1968)
Browse files Browse the repository at this point in the history
Co-authored-by: Ari Shoham <ashoham@shutterstock.com>
  • Loading branch information
arishoham and arishoham committed Nov 22, 2022
1 parent e764f2c commit 2893e9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/userAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface NavigatorUAData {
export default function getUAString(): string {
const uaData = (navigator: Navigator).userAgentData;

if (uaData?.brands) {
if (uaData?.brands && Array.isArray(uaData.brands)) {
return uaData.brands
.map((item) => `${item.brand}/${item.version}`)
.join(' ');
Expand Down

0 comments on commit 2893e9a

Please sign in to comment.