(@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)
{
// If the platform is not a browser, return immediately
if ( !this._platform.isBrowser )
{
return;
}
// Windows
if ( navigator.userAgent.includes('Win') )
{
this.osName = 'os-windows';
}
// Mac OS
if ( navigator.userAgent.includes('Mac') )
{
this.osName = 'os-mac';
}
// Unix
if ( navigator.userAgent.includes('X11') )
{
this.osName = 'os-unix';
}
// Linux
if ( navigator.userAgent.includes('Linux') )
{
this.osName = 'os-linux';
}
// iOS
if ( this._platform.IOS )
{
this.osName = 'os-ios';
}
// Android
if ( this._platform.ANDROID )
{
this.osName = 'os-android';