hotfix: hydra-canvas might already be removed

This commit is contained in:
Felix Roos 2024-03-10 02:09:46 +01:00
parent c373a0473b
commit d0c68e91dc

View File

@ -7,7 +7,7 @@ let hydra;
export async function initHydra(options = {}) {
// reset if options have changed since last init
if (latestOptions && JSON.stringify(latestOptions) !== JSON.stringify(options)) {
document.getElementById('hydra-canvas').remove();
document.getElementById('hydra-canvas')?.remove();
}
latestOptions = options;
//load and init hydra