Adrià Vilanova MartÃnez | 5f5b3e0 | 2023-07-23 00:08:17 +0200 | [diff] [blame] | 1 | import {TWPT_UPDATE_BANNER_TAG} from './components/consts.js'; |
| 2 | |
| 3 | export default class UpdateBanner { |
| 4 | addBanner(reason) { |
| 5 | const main = document.querySelector('.scrollable-content > main'); |
| 6 | if (main === null) { |
| 7 | console.error(`[updateHandlerBanner] Couldn't find main element.`); |
| 8 | return; |
| 9 | } |
| 10 | const banner = document.createElement(TWPT_UPDATE_BANNER_TAG); |
| 11 | if (reason === 'install') banner.setAttribute('isinstall', ''); |
| 12 | main.prepend(banner); |
| 13 | } |
| 14 | } |