frappe / chat

Modern Chat App for Frappe
Other
106 stars 131 forks source link

Fix chat css js URI #4

Closed ossplus closed 2 years ago

ossplus commented 2 years ago

Fix chat CSS js in the following post: https://discuss.erpnext.com/t/when-will-chat-be-ready-for-v13/80985/9

Tested in Erpnext V13.

codescientist703 commented 2 years ago

Hi, thank you for your contribution. It would be better to create a separate v13 branch for this feature as this change would break the app for the latest version.

codescientist703 commented 2 years ago

hey @ossplus , I have merged your changes in the "v13-build-fix" branch. This branch can now be used for frappe or erpnext version-13.

ankush commented 2 years ago

@codescientist703 you can conditionally define the asset variables using something like this:


from frappe import __version__ as frappe_version

above_v13  = int(frappe_version.split('.')[0]) > 13

app_include_css = 'chat.bundle.css' if above_v13 else '/assets/css/chat.bundle.css'
app_include_js = 'chat.bundle.js' if above_v13 else '/assets/css/chat.bundle.js'