fix(frontend): robust loading spinner removal using css class
This commit is contained in:
@@ -42,6 +42,10 @@
|
|||||||
transform: rotate(360deg);
|
transform: rotate(360deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.app-loaded #app-loading {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ pub fn main() {
|
|||||||
|
|
||||||
let window = web_sys::window().unwrap();
|
let window = web_sys::window().unwrap();
|
||||||
let document = window.document().unwrap();
|
let document = window.document().unwrap();
|
||||||
|
let body = document.body().unwrap();
|
||||||
|
|
||||||
|
// Add app-loaded class to body to hide spinner via CSS
|
||||||
|
let _ = body.class_list().add_1("app-loaded");
|
||||||
|
|
||||||
|
// Also try to remove it directly
|
||||||
if let Some(loader) = document.get_element_by_id("app-loading") {
|
if let Some(loader) = document.get_element_by_id("app-loading") {
|
||||||
loader.remove();
|
loader.remove();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user