Adrià Vilanova MartÃnez | 0d92a0c | 2023-11-06 01:37:20 +0100 | [diff] [blame] | 1 | import {getDisplayLanguage} from '../../utils/common.js'; |
| 2 | import PerForumStatsSection from '../../utils/PerForumStatsSection.js'; |
| 3 | |
| 4 | import BaseExtraInfoInjection from './base.js'; |
| 5 | |
| 6 | export default class ProfilePerForumStatsExtraInfoInjection extends |
| 7 | BaseExtraInfoInjection { |
| 8 | constructor(infoHandler, optionsWatcher) { |
| 9 | super(infoHandler, optionsWatcher); |
| 10 | this.displayLanguage = getDisplayLanguage(); |
| 11 | } |
| 12 | |
| 13 | async isEnabled() { |
| 14 | return await this.optionsWatcher.isEnabled('perforumstats'); |
| 15 | } |
| 16 | |
| 17 | inject(profileInfo, injectionDetails) { |
| 18 | new PerForumStatsSection( |
| 19 | injectionDetails.chart?.parentNode, profileInfo.body, |
| 20 | this.displayLanguage, /* isCommunityConsole = */ true); |
| 21 | } |
| 22 | } |