* rxjs update done
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from "@angular/router";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../environments/environment";
|
||||
import { User } from "./shared/user";
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { UserService } from "../user.service";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { Title } from "@angular/platform-browser";
|
||||
import { finalize } from 'rxjs/operators';
|
||||
|
||||
import { User } from "../shared/user";
|
||||
import { UserService } from "../user.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
@@ -32,8 +34,8 @@ export class SettingsComponent implements OnInit {
|
||||
public changePassword() {
|
||||
this.submitInProgress=true;
|
||||
if (this.user.canChangePassword) {
|
||||
this.userService.changeOwnPassword(this.oldPassword, this.newPassword)
|
||||
.finally(()=>this.submitInProgress=false)
|
||||
this.userService.changeOwnPassword(this.oldPassword, this.newPassword).pipe(
|
||||
finalize(()=>this.submitInProgress=false))
|
||||
.subscribe(
|
||||
ok => {
|
||||
if (ok) {
|
||||
@@ -54,7 +56,7 @@ export class SettingsComponent implements OnInit {
|
||||
this.submitInProgress=true;
|
||||
this.userService.changeSettings({
|
||||
wantsEmail: this.user.wantsEmail
|
||||
}).finally(()=>this.submitInProgress=false)
|
||||
}).pipe(finalize(()=>this.submitInProgress=false))
|
||||
.subscribe(okResult => this.router.navigate(['/']));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from "@angular/router";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../environments/environment";
|
||||
import { User } from "./shared/user";
|
||||
|
||||
Reference in New Issue
Block a user