Adrià Vilanova MartÃnez | 2788d12 | 2022-10-10 22:06:25 +0200 | [diff] [blame] | 1 | import {isOptionEnabled} from '../../../common/optionsUtils.js'; |
| 2 | import {addElementToThreadListActions, shouldAddBtnToActionBar} from '../utils/common.js'; |
| 3 | |
| 4 | const wfDebugId = 'twpt-workflows'; |
| 5 | |
| 6 | export 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 | }; |