import { Component } from '@angular/core' ; import { Observable } from 'rxjs' ; import { FormToastService } from '../../../../../../common/services/form-toast.service' ; import { SettingsTwoFactorV2Service } from '../../two-factor-v2.service' ; /**
 * Disable confirmation button for SMS.
 **/ @ Component ( { selector : 'm-twoFactor__confirmDisable--sms' , template : `
    <span
      *ngIf="disableMode$ | async"
      class="m-twoFactorDisable__text"
      i18n="@@2FA_PASSWORD__ARE_YOU_SURE"
      >Are you sure you want to disable two-factor authentication?</span
    >
    <m-settings--two-factor
      (saved)="onSave()"
      (disabled)="onDisable()"
    ></m-settings--two-factor>
  ` , styleUrls : [ '../confirm-disable.component.ng.scss' ] , } ) export class SettingsTwoFactorDisableSMSComponent { constructor ( private service , private toast ) { } returns { Observable < boolean > } get disableMode$ ( ) : Observable < boolean > { return this . service . smsEnabled$ ; } returns { void } public onSave ( ) { this . toast . success ( 'Successfully set up SMS MFA' ) ; this . service . reloadSettings ( ) ; this . service . activePanel$ . next ( { panel : 'root' , intent : 'enabled-sms' } ) ; } returns { void } public onDisable ( ) { this . toast . success ( 'Successfully disabled SMS MFA' ) ; this . service . reloadSettings ( ) ; this . service . activePanel$ . next ( { panel : 'root' , intent : 'disabled-sms' } ) ; } }