Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SSR (Reopen #9317) #9385

Merged
merged 9 commits into from
Jul 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle if deprecated "platform" value is not available
  • Loading branch information
matthova authored and Falke-Design committed Jul 2, 2024
commit 2d541134a0caa4ddc19e971408302636641e528e
4 changes: 2 additions & 2 deletions src/core/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ const touch = touchNative || pointer;
const retina = typeof window === 'undefined' ? false : (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;

// @property mac: Boolean; `true` when the browser is running in a Mac platform
const mac = typeof navigator === 'undefined' ? false : navigator.platform.startsWith('Mac');
const mac = typeof navigator === 'undefined' ? false : (navigator?.platform ?? '').startsWith('Mac');

// @property mac: Boolean; `true` when the browser is running in a Linux platform
const linux = typeof navigator === 'undefined' ? false : navigator.platform.startsWith('Linux');
const linux = typeof navigator === 'undefined' ? false : (navigator?.platform ?? '').startsWith('Linux');

function userAgentContains(str) {
if (typeof navigator === 'undefined') {
Expand Down