Upgrade: Angular 18, Ionic 8, Capacitor 6
Modernizacion completa del frontend: - Angular 8 -> 18.2.14 - Ionic 4 -> 8.7.17 - Capacitor 6.x (migracion desde Cordova/@ionic-native) - TypeScript 5.4.5 - Swiper 11 con Web Components API Cambios principales: - Migrar NativeStorage a @capacitor/preferences - Migrar InAppBrowser a @capacitor/browser - Migrar Camera a @capacitor/camera - Migrar Geolocation a @capacitor/geolocation - Migrar StatusBar/SplashScreen a Capacitor - Migrar Facebook/Google login a plugins Capacitor - Actualizar lazy loading syntax (Angular 12+) - Configurar buildOptimizer: false para Ionic 8 - Limpiar package.json de dependencias obsoletas - Agregar README con guia de instalacion Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
23
src/app/verify/verify.page.ts
Normal file → Executable file
23
src/app/verify/verify.page.ts
Normal file → Executable file
@@ -1,9 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, LoadingController, NavController } from '@ionic/angular';
|
||||
import { LoadingController, NavController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { NgForm } from '@angular/forms';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { OneSignal, OSNotificationPayload } from '@ionic-native/onesignal/ngx';
|
||||
// TODO: Install and configure OneSignal Capacitor plugin for push notifications
|
||||
|
||||
@Component({
|
||||
selector: 'app-verify',
|
||||
@@ -13,14 +13,12 @@ import { OneSignal, OSNotificationPayload } from '@ionic-native/onesignal/ngx';
|
||||
export class VerifyPage implements OnInit {
|
||||
|
||||
phone_string: string = "phone";
|
||||
private loading;
|
||||
private loading: any;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private authService: AuthService,
|
||||
private navCtrl: NavController,
|
||||
private alertService: AlertService,
|
||||
private oneSignal: OneSignal,
|
||||
private loadingCtrl: LoadingController,
|
||||
) { }
|
||||
ngOnInit() {
|
||||
@@ -41,22 +39,21 @@ export class VerifyPage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
logout() {
|
||||
this.loadingCtrl.create().then((overlay) => {
|
||||
this.loading = overlay;
|
||||
this.loading.present();
|
||||
});
|
||||
async logout() {
|
||||
this.loading = await this.loadingCtrl.create();
|
||||
await this.loading.present();
|
||||
|
||||
this.authService.logout().subscribe(
|
||||
data => {
|
||||
this.alertService.presentToast("Sesión finalizada");
|
||||
this.oneSignal.sendTag("iChamba_ID", null);
|
||||
// TODO: Clear OneSignal tag when Capacitor plugin is configured
|
||||
},
|
||||
error => {
|
||||
this.loading.dismiss();
|
||||
if (this.loading) this.loading.dismiss();
|
||||
console.log(error);
|
||||
},
|
||||
() => {
|
||||
this.loading.dismiss();
|
||||
if (this.loading) this.loading.dismiss();
|
||||
this.navCtrl.navigateRoot('/landing');
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user