mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[SM-403] fix: manually detectChanges in Product Switcher (#4307)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Component, Input } from "@angular/core";
|
import { AfterViewInit, ChangeDetectorRef, Component, Input } from "@angular/core";
|
||||||
|
|
||||||
import { IconButtonType } from "@bitwarden/components/src/icon-button/icon-button.component";
|
import { IconButtonType } from "@bitwarden/components/src/icon-button/icon-button.component";
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ import { flagEnabled } from "../../../utils/flags";
|
|||||||
selector: "product-switcher",
|
selector: "product-switcher",
|
||||||
templateUrl: "./product-switcher.component.html",
|
templateUrl: "./product-switcher.component.html",
|
||||||
})
|
})
|
||||||
export class ProductSwitcherComponent {
|
export class ProductSwitcherComponent implements AfterViewInit {
|
||||||
protected isEnabled = flagEnabled("secretsManager");
|
protected isEnabled = flagEnabled("secretsManager");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,4 +16,15 @@ export class ProductSwitcherComponent {
|
|||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
buttonType: IconButtonType = "main";
|
buttonType: IconButtonType = "main";
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
/**
|
||||||
|
* Resolves https://angular.io/errors/NG0100 [SM-403]
|
||||||
|
*
|
||||||
|
* Caused by `[bitMenuTriggerFor]="content?.menu"` in template
|
||||||
|
*/
|
||||||
|
this.changeDetector.detectChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(private changeDetector: ChangeDetectorRef) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user