OvidijusParsiunas / deep-chat

Fully customizable AI chatbot component for your website
https://deepchat.dev
MIT License
1.26k stars 170 forks source link

Disabling loading of google webfont #136

Open matthiasamberg opened 4 months ago

matthiasamberg commented 4 months ago

Hi there

not a bug, but how can I disable the loading of the Google Web Font Inter? I did change the fonts of the main component, and it seems, that Inter is not used anymore. However the googlefont css is still injected into the head and the call to google is still made. For privacy reasons I'd prefer if that call wouldn't happen. Is there a way for me to disable this?

Thanks and TIA!

OvidijusParsiunas commented 4 months ago

That's a really good question, let me think about this one.

OvidijusParsiunas commented 4 months ago

The fix for this is now available in the deep-caht-dev and deep-chat-react-dev packages version 9.0.139

The dev packages behave the same way as the original ones - except their names are different. The next release for Deep Chat is going to be a big one as we are migrating a lot of its logic to another web component called active chat and with that we are changing quite a few property names, such as changing the request property to connect and initialMessages to history. The old properties will still keep working as usual except you will see warnings in the console for their deprecation. Most importantly, because this is going to be a very big release - it is likely that it will take place some time next month, so the font fix is going to remain in the dev packages until this will happen.

Let me know if you have any questions or issues. Thanks!

matthiasamberg commented 4 months ago

Thank you! I think I wait for the proper release next month. I couldn't find a commit related to it. Does it mean, if I use other fonts it won't download the gFont anymore automatically, or is there something else we have to do?

Thanks again!

OvidijusParsiunas commented 4 months ago

Hey @matthiasamberg. I had the code for the fix in my local repo, I have just deployed it in this commit.

And you are correct, if the default font-family ('Inter', sans-serif, Avenir, Helvetica, Arial) is not used, the Google Font is not going to be downloaded.