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

FEAT #13526 TIME 0:45 fix pinned folder

parent 9d0fc2f7
No related branches found
No related tags found
No related merge requests found
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { LANG } from '../../translate.component';
......@@ -15,6 +15,8 @@ export class FolderPinnedComponent implements OnInit {
lang: any = LANG;
subscription: Subscription;
@Input('noInit') noInit: boolean = false;
constructor(
public http: HttpClient,
......@@ -28,7 +30,9 @@ export class FolderPinnedComponent implements OnInit {
ngOnInit(): void {
this.foldersService.initFolder();
this.foldersService.getPinnedFolders();
if (!this.noInit) {
this.foldersService.getPinnedFolders();
}
}
gotToFolder(folder: any) {
......
......@@ -4,7 +4,7 @@
<i class="fa fa-thumbtack panelIconMenu"></i>&nbsp;{{lang.myPinnedFolder}}
</mat-panel-title>
</mat-expansion-panel-header>
<folder-pinned></folder-pinned>
<folder-pinned [noInit]="true"></folder-pinned>
</mat-expansion-panel>
<mat-divider></mat-divider>
<mat-expansion-panel class="folderList" [expanded]="false">
......
import { Component, OnInit, Input, ViewChild, Output, EventEmitter } from '@angular/core';
import { Component, OnInit, Input, ViewChild, Output, EventEmitter, ChangeDetectorRef } from '@angular/core';
import { LANG } from '../../translate.component';
import { FolderTreeComponent } from '../folder-tree.component';
import { FoldersService } from '../folders.service';
......@@ -18,6 +18,7 @@ export class PanelFolderComponent implements OnInit {
lang: any = LANG;
@Input('selectedId') id: number;
@ViewChild('folderTree', { static: false }) folderTree: FolderTreeComponent;
@Output('refreshEvent') refreshEvent = new EventEmitter<string>();
......@@ -27,13 +28,17 @@ export class PanelFolderComponent implements OnInit {
constructor(
public foldersService: FoldersService,
public actionService: ActionsService,
private changeDetectorRef: ChangeDetectorRef
) {
this.subscription = this.actionService.catchAction().subscribe(message => {
this.refreshFoldersTree();
});
}
ngOnInit(): void { }
ngOnInit(): void {
this.foldersService.getPinnedFolders();
}
ngOnDestroy() {
// unsubscribe to ensure no memory leaks
......
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