Skip to content

Commit

Permalink
fix: add stylesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
DecathectZero committed Oct 26, 2023
1 parent d5bed8e commit 15aaa42
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react-chat/src/utils/stylesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 15aaa42

Please sign in to comment.