From 1bf4c48cdc3b27f5833cd33d3abbbb544bb1f217 Mon Sep 17 00:00:00 2001 From: Sercan Yemen <117369+srcn@users.noreply.github.com> Date: Wed, 25 May 2022 11:25:37 +0300 Subject: [PATCH] (@fuse/service/platform) Added comments to the service file --- src/@fuse/services/platform/platform.service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/@fuse/services/platform/platform.service.ts b/src/@fuse/services/platform/platform.service.ts index a8267070..9c350eb7 100644 --- a/src/@fuse/services/platform/platform.service.ts +++ b/src/@fuse/services/platform/platform.service.ts @@ -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';