fix: safeguarding selected widgets saga (#7133)
This commit is contained in:
parent
77a33f770d
commit
eee2e97728
|
|
@ -480,3 +480,10 @@ export const MORE_OPTIONS = () => "More Options";
|
|||
export const ADD_REACTION = () => "Add Reaction";
|
||||
export const RESOLVE_THREAD = () => "Resolve Thread";
|
||||
export const EMOJI = () => "Emoji";
|
||||
|
||||
// Sniping mode messages
|
||||
export const SNIPING_SELECT_WIDGET_AGAIN = () =>
|
||||
"Unable to detect the widget, please select the widget again.";
|
||||
|
||||
export const SNIPING_NOT_SUPPORTED = () =>
|
||||
"Binding on selection is not supported for this type of widget!";
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ import { RenderModes, WidgetTypes } from "../constants/WidgetConstants";
|
|||
import { Toaster } from "../components/ads/Toast";
|
||||
import { Variant } from "../components/ads/common";
|
||||
import AnalyticsUtil from "../utils/AnalyticsUtil";
|
||||
import {
|
||||
SNIPING_NOT_SUPPORTED,
|
||||
SNIPING_SELECT_WIDGET_AGAIN,
|
||||
} from "../constants/messages";
|
||||
|
||||
export function* bindDataToWidgetSaga(
|
||||
action: ReduxAction<{
|
||||
|
|
@ -37,6 +41,14 @@ export function* bindDataToWidgetSaga(
|
|||
action.payload.widgetId
|
||||
];
|
||||
|
||||
if (!selectedWidget || !selectedWidget.type) {
|
||||
Toaster.show({
|
||||
text: SNIPING_SELECT_WIDGET_AGAIN(),
|
||||
variant: Variant.warning,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let propertyPath = "";
|
||||
let propertyValue: any = "";
|
||||
let isValidProperty = true;
|
||||
|
|
@ -143,7 +155,7 @@ export function* bindDataToWidgetSaga(
|
|||
} else {
|
||||
queryId &&
|
||||
Toaster.show({
|
||||
text: "Binding on selection is not supported for this type of widget!",
|
||||
text: SNIPING_NOT_SUPPORTED(),
|
||||
variant: Variant.warning,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user