blob: 1c99729dcf1f83e8cd52e0599a4638e98b839401 [file] [log] [blame]
Adrià Vilanova Martínez2788d122022-10-10 22:06:25 +02001import {isOptionEnabled} from '../../../common/optionsUtils.js';
2import {addElementToThreadListActions, shouldAddBtnToActionBar} from '../utils/common.js';
3
4const wfDebugId = 'twpt-workflows';
5
6export default class Workflows {
7 constructor() {}
8
9 addThreadListBtnIfEnabled(readToggle) {
10 isOptionEnabled('workflows').then(isEnabled => {
11 if (isEnabled) {
12 const menu = document.createElement('twpt-workflows-menu');
13 addElementToThreadListActions(readToggle, menu);
14 }
15 });
16 }
17
18 shouldAddThreadListBtn(node) {
19 return shouldAddBtnToActionBar(wfDebugId, node);
20 }
21};