Skip to content

Commit

Permalink
Merge pull request #328 from Cafnanc/calendar
Browse files Browse the repository at this point in the history
fix for white screen
  • Loading branch information
kiranharidas187 authored Dec 8, 2023
2 parents bad640c + d6023a1 commit 28b7024
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { App, URLOpenListenerEvent } from '@capacitor/app';
import { environment } from 'src/environments/environment';
import { Capacitor } from '@capacitor/core';
import { SwUpdate } from '@angular/service-worker';

@Component({
selector: 'app-root',
Expand Down Expand Up @@ -57,7 +58,8 @@ export class AppComponent {
private zone:NgZone,
private _location: Location,
private alert: AlertController,
private screenOrientation: ScreenOrientation
private screenOrientation: ScreenOrientation,
private swUpdate: SwUpdate
) {
this.menuSubscription = this.utilService.canIonMenuShow.subscribe(data =>{
this.showMenu = data
Expand All @@ -74,6 +76,18 @@ export class AppComponent {
}
}

ngOnInit(){
if (this.swUpdate.isEnabled) {
this.swUpdate.checkForUpdate().then((data) => {
if(data){
this.swUpdate.activateUpdate().then((data)=>{
window.location.reload()
})
}
});
}
}

shouldHideMenu(url: string): boolean {
if(url.includes('/auth')){
return false;
Expand Down

0 comments on commit 28b7024

Please sign in to comment.