Skip to content

Commit

Permalink
use property that will always be defined in my append header hack
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Jan 8, 2025
1 parent 77c0349 commit b9471bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/viewer/src/lib/append-head-hack.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
if (import.meta.env.DEV) {
//when in dev mode, svelte and vite want to put style sheets in the head
//however blazor will remove them, so we need to put them in the body instead
// eslint-disable-next-line @typescript-eslint/unbound-method
const headerAppend = document.head.appendChild;
document.head.appendChild = function newAppend<T extends Node>(node: T) {
//this is used for both svelte and vite imports
if (node.tagName === 'STYLE') {
if (node.nodeName === 'STYLE') {
document.getElementById('svelte-app')?.appendChild(node);
} else {
headerAppend.call(document.head, node);
Expand Down

0 comments on commit b9471bf

Please sign in to comment.