Skip to content

Commit 6f959cc

Browse files
committed
update send event
1 parent 096c86f commit 6f959cc

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

reflex_ui/blocks/demo_form.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
based on company size.
66
"""
77

8+
import asyncio
89
import os
910
import urllib.parse
1011
import uuid
@@ -319,13 +320,12 @@ async def send_demo_event(self, form_data: dict[str, Any]):
319320
)
320321

321322
# Send data to PostHog, Common Room, and Slack
322-
yield [
323-
DemoFormStateUI.send_data_to_posthog(demo_event),
324-
DemoFormStateUI.send_data_to_common_room(demo_event),
325-
DemoFormStateUI.send_data_to_slack(demo_event),
326-
]
323+
await asyncio.gather(
324+
self.send_data_to_posthog(demo_event),
325+
self.send_data_to_common_room(demo_event),
326+
self.send_data_to_slack(demo_event),
327+
)
327328

328-
@rx.event(background=True)
329329
async def send_data_to_posthog(self, event_instance: PosthogEvent):
330330
"""Send data to PostHog using class introspection.
331331
@@ -349,7 +349,6 @@ async def send_data_to_posthog(self, event_instance: PosthogEvent):
349349
except Exception:
350350
log("Error sending data to PostHog")
351351

352-
@rx.event(background=True)
353352
async def send_data_to_common_room(self, event_instance: DemoEvent):
354353
"""Update CommonRoom with user login information."""
355354
tags: Sequence[str] = [
@@ -385,14 +384,14 @@ async def send_data_to_common_room(self, event_instance: DemoEvent):
385384
f"CommonRoom: Failed to identify user with email {event_instance.company_email}, err: {ex}"
386385
)
387386

388-
@rx.event(background=True)
389387
async def send_data_to_slack(self, event_instance: DemoEvent):
390388
"""Send demo form data to Slack webhook.
391389
392390
Args:
393391
event_instance: An instance of DemoEvent with form data.
394392
"""
395393
slack_payload = {
394+
"technicalLevel": event_instance.technical_level,
396395
"lookingToBuild": event_instance.internal_tools,
397396
"businessEmail": event_instance.company_email,
398397
"howDidYouHear": event_instance.referral_source,

0 commit comments

Comments
 (0)