Fixed announcement bar insertion

no issue
- Checked if react root div was already inserted to avoid duplication.
This commit is contained in:
Elena Baidakova 2023-04-21 15:15:01 +04:00
parent b6320ca976
commit b893ec13ab

View File

@ -6,6 +6,10 @@ import {App} from './App';
const ROOT_DIV_ID = 'announcement-bar-root';
function addRootDiv() {
if (document.getElementById(ROOT_DIV_ID)) {
return;
}
const elem = document.createElement('div');
elem.id = ROOT_DIV_ID;
document.body.prepend(elem);