Merge pull request #387 from vector-im/bwindels/dontassumecontaineratload
Don't assume container node exists when loading bundle
This commit is contained in:
commit
23321b4c76
1 changed files with 5 additions and 2 deletions
|
@ -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(),
|
||||
|
|
Reference in a new issue