From 15aaa42e735171ec989ed28fb82ab65201613b0b Mon Sep 17 00:00:00 2001 From: Tyler Han Date: Thu, 26 Oct 2023 11:33:18 -0400 Subject: [PATCH] fix: add stylesheet --- packages/react-chat/src/utils/stylesheet.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-chat/src/utils/stylesheet.ts b/packages/react-chat/src/utils/stylesheet.ts index dd02316350..3059680c58 100644 --- a/packages/react-chat/src/utils/stylesheet.ts +++ b/packages/react-chat/src/utils/stylesheet.ts @@ -6,14 +6,13 @@ import { Assistant } from '@/common'; // used to add stylesheets dynamically, resolves when loaded export const addStyleSheetURL = async (url: string) => { const link = document.createElement('link'); - link.rel = 'stylesheet'; - link.href = url; - const load = new Promise((resolve, reject) => { link.onload = resolve; link.onerror = reject; }); + link.rel = 'stylesheet'; + link.href = url; document.head.appendChild(link); await load;