Merge pull request #387 from vector-im/bwindels/dontassumecontaineratload

Don't assume container node exists when loading bundle
This commit is contained in:
Bruno Windels 2021-06-04 13:37:43 +00:00 committed by GitHub
commit 23321b4c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,10 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
const container = document.querySelector(".hydrogen");
let container;
export function spinner(t, extraClasses = undefined) {
if (container.classList.contains("legacy")) {
if (container === undefined) {
container = document.querySelector(".hydrogen");
}
if (container?.classList.contains("legacy")) {
return t.div({className: "spinner"}, [
t.div(),
t.div(),