Pass launchCipher down to grandchild for reuse

This commit is contained in:
Thomas Rittson 2021-01-27 15:34:14 +10:00
parent 1d79172876
commit 4045ce2d15
2 changed files with 4 additions and 10 deletions

View File

@ -29,6 +29,7 @@ import { PopupUtilsService } from '../services/popup-utils.service';
})
export class ActionButtonsComponent {
@Output() onView = new EventEmitter<CipherView>();
@Output() onLaunch = new EventEmitter<CipherView>();
@Input() cipher: CipherView;
@Input() showView = false;
@ -45,15 +46,7 @@ export class ActionButtonsComponent {
}
launch() {
if (this.cipher.type !== CipherType.Login || !this.cipher.login.canLaunch) {
return;
}
this.analytics.eventTrack.next({ action: 'Launched URI From Listing' });
BrowserApi.createNewTab(this.cipher.login.launchUri);
if (this.popupUtilsService.inPopup(window)) {
BrowserApi.closePopup(window);
}
this.onLaunch.emit(this.cipher);
}
async copy(cipher: CipherView, value: string, typeI18nKey: string, aType: string) {

View File

@ -17,6 +17,7 @@
<span class="detail">{{c.subTitle}}</span>
</div>
</div>
<app-action-buttons [cipher]="c" [showView]="showView" (onView)="viewCipher(c)" class="action-buttons">
<app-action-buttons [cipher]="c" [showView]="showView" (onView)="viewCipher(c)" (onLaunch)="doubleSelectCipher(c)"
class="action-buttons">
</app-action-buttons>
</a>