blob: c2da6b426d11b59e36e5b0c46bf5135e26627e4f [file] [log] [blame]
Adrià Vilanova Martínez5f5b3e02023-07-23 00:08:17 +02001import {TWPT_UPDATE_BANNER_TAG} from './components/consts.js';
2
3export 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}