Skip to content
Snippets Groups Projects
Commit 62f42388 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

fix update nb res tracking

parent 43363bd8
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
[fixedInViewport]="appService.getViewMode()" [opened]="appService.getViewMode() ? false : true" autoFocus="false" [fixedInViewport]="appService.getViewMode()" [opened]="appService.getViewMode() ? false : true" autoFocus="false"
style="overflow-x:hidden;" [ngStyle]="{'width': appService.getViewMode() ? '80%' : '350px'}"> style="overflow-x:hidden;" [ngStyle]="{'width': appService.getViewMode() ? '80%' : '350px'}">
<header-panel [snavLeft]="snav"></header-panel> <header-panel [snavLeft]="snav"></header-panel>
<menu-shortcut></menu-shortcut> <menu-shortcut #menuShortcut></menu-shortcut>
<menu-nav></menu-nav> <menu-nav></menu-nav>
<basket-home #basketHome (refreshEvent)="refreshDao()" [snavL]="snav" <basket-home #basketHome (refreshEvent)="refreshDao()" [snavL]="snav"
[currentBasketInfo]="currentBasketInfo"></basket-home> [currentBasketInfo]="currentBasketInfo"></basket-home>
......
...@@ -9,7 +9,7 @@ import { MatSidenav } from '@angular/material/sidenav'; ...@@ -9,7 +9,7 @@ import { MatSidenav } from '@angular/material/sidenav';
import { MatSort } from '@angular/material/sort'; import { MatSort } from '@angular/material/sort';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { startWith, switchMap, map, catchError, takeUntil } from 'rxjs/operators'; import { startWith, switchMap, map, catchError, takeUntil, tap } from 'rxjs/operators';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { HeaderService } from '../../service/header.service'; import { HeaderService } from '../../service/header.service';
import { FiltersListService } from '../../service/filtersList.service'; import { FiltersListService } from '../../service/filtersList.service';
...@@ -24,6 +24,7 @@ import { PanelFolderComponent } from '../folder/panel/panel-folder.component'; ...@@ -24,6 +24,7 @@ import { PanelFolderComponent } from '../folder/panel/panel-folder.component';
import { FoldersService } from '../folder/folders.service'; import { FoldersService } from '../folder/folders.service';
import { ActionsService } from '../actions/actions.service'; import { ActionsService } from '../actions/actions.service';
import { ContactsListModalComponent } from '../contact/list/modal/contacts-list-modal.component'; import { ContactsListModalComponent } from '../contact/list/modal/contacts-list-modal.component';
import { MenuShortcutComponent } from '../menu/menu-shortcut.component';
declare function $j(selector: any): any; declare function $j(selector: any): any;
...@@ -99,6 +100,7 @@ export class BasketListComponent implements OnInit { ...@@ -99,6 +100,7 @@ export class BasketListComponent implements OnInit {
@ViewChild('filtersTool', { static: true }) filtersTool: FiltersToolComponent; @ViewChild('filtersTool', { static: true }) filtersTool: FiltersToolComponent;
@ViewChild('appPanelList', { static: true }) appPanelList: PanelListComponent; @ViewChild('appPanelList', { static: true }) appPanelList: PanelListComponent;
@ViewChild('basketHome', { static: true }) basketHome: BasketHomeComponent; @ViewChild('basketHome', { static: true }) basketHome: BasketHomeComponent;
@ViewChild('menuShortcut', { static: true }) menuShortcut: MenuShortcutComponent;
@ViewChild('panelFolder', { static: true }) panelFolder: PanelFolderComponent; @ViewChild('panelFolder', { static: true }) panelFolder: PanelFolderComponent;
currentSelectedChrono: string = ''; currentSelectedChrono: string = '';
...@@ -491,6 +493,7 @@ export class BasketListComponent implements OnInit { ...@@ -491,6 +493,7 @@ export class BasketListComponent implements OnInit {
toggleMailTracking(row: any) { toggleMailTracking(row: any) {
if (!row.mailTracking) { if (!row.mailTracking) {
this.http.post('../../rest/resources/follow', {resources: [row.resId]}).pipe( this.http.post('../../rest/resources/follow', {resources: [row.resId]}).pipe(
tap(() => this.menuShortcut.nbResourcesFollowed++),
catchError((err: any) => { catchError((err: any) => {
this.notify.handleErrors(err); this.notify.handleErrors(err);
return of(false); return of(false);
...@@ -498,6 +501,7 @@ export class BasketListComponent implements OnInit { ...@@ -498,6 +501,7 @@ export class BasketListComponent implements OnInit {
).subscribe(); ).subscribe();
} else { } else {
this.http.request('DELETE', '../../rest/resources/unfollow', { body: { resources: [row.resId] } }).pipe( this.http.request('DELETE', '../../rest/resources/unfollow', { body: { resources: [row.resId] } }).pipe(
tap(() => this.menuShortcut.nbResourcesFollowed--),
catchError((err: any) => { catchError((err: any) => {
this.notify.handleErrors(err); this.notify.handleErrors(err);
return of(false); return of(false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment