diff --git a/frontend/src/Editor/Inspector/EventManager.jsx b/frontend/src/Editor/Inspector/EventManager.jsx
index a1321a846d..a5ea03795f 100644
--- a/frontend/src/Editor/Inspector/EventManager.jsx
+++ b/frontend/src/Editor/Inspector/EventManager.jsx
@@ -85,6 +85,7 @@ export const EventManager = ({
const [events, setEvents] = useState([]);
const [focusedEventIndex, setFocusedEventIndex] = useState(null);
+ const [loadingStates, setLoadingStates] = useState({});
const { t } = useTranslation();
@@ -353,7 +354,8 @@ export const EventManager = ({
}
function addHandler() {
- let newEvents = events;
+ setLoadingStates((prev) => ({ ...prev, [sourceId]: true }));
+ let newEvents = [...events];
const eventIndex = newEvents.length;
createAppVersionEventHandlers({
event: {
@@ -366,9 +368,13 @@ export const EventManager = ({
eventType: eventSourceType,
attachedTo: sourceId,
index: eventIndex,
- });
-
- handleYmapEventUpdates();
+ })
+ .then(() => {
+ handleYmapEventUpdates();
+ })
+ .finally(() => {
+ setLoadingStates((prev) => ({ ...prev, [sourceId]: false }));
+ });
}
//following two are functions responsible for on change and value for the control specific actions
@@ -414,7 +420,7 @@ export const EventManager = ({
}}
>
-
+
{t('editor.inspector.eventManager.event', 'Event')}
@@ -431,8 +437,8 @@ export const EventManager = ({
/>
-
-
+
+
{t('editor.inspector.eventManager.action', 'Action')}
@@ -450,8 +456,8 @@ export const EventManager = ({
-
-
+
+
{t('editor.inspector.eventManager.runOnlyIf', 'Run Only If')}
@@ -474,7 +480,7 @@ export const EventManager = ({
{event.actionId === 'show-alert' && (
<>
-
+
{t('editor.inspector.eventManager.message', 'Message')}
@@ -488,8 +494,8 @@ export const EventManager = ({
/>
-
-
+
+
{t('editor.inspector.eventManager.alertType', 'Alert Type')}
@@ -511,7 +517,7 @@ export const EventManager = ({
{event.actionId === 'open-webpage' && (
-
+
- {t('editor.inspector.eventManager.modal', 'Modal')}
+ {t('editor.inspector.eventManager.modal', 'Modal')}