Skip to content

Commit 5d10949

Browse files
committed
fix: The application cannot be embedded
1 parent c6f821c commit 5d10949

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

apps/application/serializers/application_serializers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ def get_embed(self, with_valid=True, params=None):
279279
'x_type': float_location.get('x', {}).get('type', 'right'),
280280
'x_value': float_location.get('x', {}).get('value', 0),
281281
'y_type': float_location.get('y', {}).get('type', 'bottom'),
282-
'y_value': float_location.get('y', {}).get('value', 30)}))
282+
'y_value': float_location.get('y', {}).get('value', 30),
283+
'max_kb_id': str(uuid.uuid1()).replace('-', '')}))
283284
response = HttpResponse(s, status=200, headers={'Content-Type': 'text/javascript'})
284285
return response
285286

apps/application/template/embed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const initChat=(root)=>{
132132
function initMaxkb(){
133133
const maxkb=document.createElement('div')
134134
const root=document.createElement('div')
135-
const maxkbId = 'maxkb-'+crypto.randomUUID().split('-')[0]
135+
const maxkbId = 'maxkb-'+'{{max_kb_id}}'
136136
root.id=maxkbId
137137
initMaxkbStyle(maxkb, maxkbId)
138138
maxkb.appendChild(root)

0 commit comments

Comments
 (0)