(@fuse/service/platform) Added comments to the service file

This commit is contained in:
Sercan Yemen 2022-05-25 11:25:37 +03:00
parent ea9efc3dc2
commit 1bf4c48cdc

View File

@ -13,36 +13,43 @@ export class FusePlatformService
*/ */
constructor(private _platform: Platform) constructor(private _platform: Platform)
{ {
// If the platform is not a browser, return immediately
if ( !this._platform.isBrowser ) if ( !this._platform.isBrowser )
{ {
return; return;
} }
// Windows
if ( navigator.userAgent.includes('Win') ) if ( navigator.userAgent.includes('Win') )
{ {
this.osName = 'os-windows'; this.osName = 'os-windows';
} }
// Mac OS
if ( navigator.userAgent.includes('Mac') ) if ( navigator.userAgent.includes('Mac') )
{ {
this.osName = 'os-mac'; this.osName = 'os-mac';
} }
// Unix
if ( navigator.userAgent.includes('X11') ) if ( navigator.userAgent.includes('X11') )
{ {
this.osName = 'os-unix'; this.osName = 'os-unix';
} }
// Linux
if ( navigator.userAgent.includes('Linux') ) if ( navigator.userAgent.includes('Linux') )
{ {
this.osName = 'os-linux'; this.osName = 'os-linux';
} }
// iOS
if ( this._platform.IOS ) if ( this._platform.IOS )
{ {
this.osName = 'os-ios'; this.osName = 'os-ios';
} }
// Android
if ( this._platform.ANDROID ) if ( this._platform.ANDROID )
{ {
this.osName = 'os-android'; this.osName = 'os-android';