mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-8091] Testing Angular 15 - The “Create” and “Upload” button from Personal Files are sometimes loaded also on Libraries Page if opened quickly (#3881)
* aaaaa * [ACS-8091] - Testing Angular 15 - The “Create” and “Upload” button from Personal Files are sometimes loaded also on Libraries Page if opened quickly
This commit is contained in:
@@ -91,26 +91,29 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
this.title = data.title;
|
this.title = data.title;
|
||||||
|
|
||||||
this.route.queryParamMap.subscribe((queryMap: Params) => {
|
this.route.queryParamMap.pipe(takeUntil(this.onDestroy$)).subscribe((queryMap: Params) => {
|
||||||
this.queryParams = queryMap.params;
|
this.queryParams = queryMap.params;
|
||||||
});
|
});
|
||||||
this.route.params.subscribe(({ folderId }: Params) => {
|
this.route.params.pipe(takeUntil(this.onDestroy$)).subscribe(({ folderId }: Params) => {
|
||||||
const nodeId = folderId || data.defaultNodeId;
|
const nodeId = folderId || data.defaultNodeId;
|
||||||
|
|
||||||
this.contentApi.getNode(nodeId).subscribe(
|
this.contentApi
|
||||||
(node) => {
|
.getNode(nodeId)
|
||||||
this.isValidPath = true;
|
.pipe(takeUntil(this.onDestroy$))
|
||||||
|
.subscribe(
|
||||||
|
(node) => {
|
||||||
|
this.isValidPath = true;
|
||||||
|
|
||||||
if (node?.entry?.isFolder) {
|
if (node?.entry?.isFolder) {
|
||||||
void this.updateCurrentNode(node.entry);
|
void this.updateCurrentNode(node.entry);
|
||||||
} else {
|
} else {
|
||||||
void this.router.navigate(['/personal-files', node.entry.parentId], {
|
void this.router.navigate(['/personal-files', node.entry.parentId], {
|
||||||
replaceUrl: true
|
replaceUrl: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
() => (this.isValidPath = false)
|
() => (this.isValidPath = false)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.subscriptions = this.subscriptions.concat([
|
this.subscriptions = this.subscriptions.concat([
|
||||||
|
Reference in New Issue
Block a user