refactor to define helper service more accurately

This commit is contained in:
itzMiney committed 2026-03-17 23:21:12 +01:00
1 parent 5527acfb6a
commit 7618e4bf5d
28 files changed
+78 -403

No files matched your search

@@ -4,8 +4,8 @@ import {isPlatformBrowser} from '@angular/common';
@Injectable({
providedIn: 'root',
})
export class DeviceDetectorService {
isMobile: boolean = false;
export class ViewportService {
isNarrow: boolean = false;
constructor(@Inject(PLATFORM_ID) private platformId: Object) {
this.updateDeviceType();
@@ -16,9 +16,9 @@ export class DeviceDetectorService {
private updateDeviceType() {
if (isPlatformBrowser(this.platformId)) {
this.isMobile = window.innerWidth <= 768;
this.isNarrow = window.innerWidth <= 768;
} else {
this.isMobile = false;
this.isNarrow = false;
}
}
}