Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into main
  • Loading branch information
nidhikachhawa24 committed May 28, 2024
2 parents 80645ce + 55cd6e3 commit fcaa14b
Show file tree
Hide file tree
Showing 50 changed files with 151 additions and 140 deletions.
24 changes: 16 additions & 8 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,24 @@ export class AppComponent implements OnInit {
private modalCtrl: ModalController,
private router: Router,
private swUpdate: SwUpdate) {
this.initializeApp();
this.swUpdate.versionUpdates.subscribe(evt => {
switch (evt.type) {
case 'VERSION_DETECTED':
console.log(`Downloading new app version: ${evt.version.hash}`);
break;
case 'VERSION_READY':
console.log(`Current app version: ${evt.currentVersion.hash}`);
console.log(`New app version ready for use: ${evt.latestVersion.hash}`);
break;
case 'VERSION_INSTALLATION_FAILED':
console.log(`Failed to install app version '${evt.version.hash}': ${evt.error}`);
break;
}
});
}

initializeApp(): void {
if (this.swUpdate.available) {
this.swUpdate.available.subscribe(() => {
if (confirm('A new version is available. Load it?'))
window.location.reload();
});
}

}

async ngOnInit() {
Expand Down Expand Up @@ -147,4 +155,4 @@ export class AppComponent implements OnInit {
await modal.present();
modal.onDidDismiss();
}
}
}
15 changes: 9 additions & 6 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { DirectivesModule } from './directives/directives.module';
import { DownlaodContentService } from './services/downlaod-content.service';
import { AppUpdateService } from './services/app-update/app-update.service';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../../configuration/environment.prod';

export function translateHttpLoaderFactory(httpClient: HttpClient) {
return new TranslateHttpLoader(httpClient, './assets/i18n/', '.json');
Expand All @@ -56,12 +57,14 @@ export function initializeFactory(init: DbService) {
}),
ComponentsModule,
DirectivesModule,
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: !isDevMode(),
// Register the ServiceWorker as soon as the application is stable
// or after 30 seconds (whichever comes first).
registrationStrategy: 'registerWhenStable:30000'
})],
// ServiceWorkerModule.register('ngsw-worker.js', {
// enabled: !isDevMode(),
// // Register the ServiceWorker as soon as the application is stable
// // or after 30 seconds (whichever comes first).
// registrationStrategy: 'registerWhenStable:30000'
// })
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
],
providers: [
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
StorageService,
Expand Down
6 changes: 3 additions & 3 deletions src/app/services/api/http.capacitor.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export class HttpCapacitorAdapter implements HttpClient {
{

const mediaUrl = url;
console.log(mediaUrl);
console.log(mediaUrl.endsWith(".mp3"));
// console.log(mediaUrl);
// console.log(mediaUrl.endsWith(".mp3"));


if (mediaUrl.endsWith(".mp3")) {
Expand Down Expand Up @@ -246,4 +246,4 @@ export class HttpCapacitorAdapter implements HttpClient {

return observable;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions www/1227.62126f61607726d4.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion www/1227.caeaa0e1fff748b5.js

This file was deleted.

1 change: 1 addition & 0 deletions www/1577.e38109e3217876c6.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion www/1577.f78a0447c8f41a1b.js

This file was deleted.

Large diffs are not rendered by default.

Loading

0 comments on commit fcaa14b

Please sign in to comment.