mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge pull request #3004 from tdonohue/fix_3000
Fix `TypeError: Cannot read properties of undefined (reading 'userAgent')`
This commit is contained in:
@@ -144,7 +144,7 @@ export class RootComponent implements OnInit {
|
||||
}
|
||||
|
||||
getBrowserName(): string {
|
||||
const userAgent = this._window.nativeWindow.navigator.userAgent;
|
||||
const userAgent = this._window.nativeWindow.navigator?.userAgent;
|
||||
if (/Firefox/.test(userAgent)) {
|
||||
return 'firefox';
|
||||
}
|
||||
@@ -155,7 +155,7 @@ export class RootComponent implements OnInit {
|
||||
}
|
||||
|
||||
getOSName(): string {
|
||||
const userAgent = this._window.nativeWindow.navigator.userAgent;
|
||||
const userAgent = this._window.nativeWindow.navigator?.userAgent;
|
||||
if (/Windows/.test(userAgent)) {
|
||||
return 'windows';
|
||||
}
|
||||
|
Reference in New Issue
Block a user