fix rule editor remounting issue (#34228)

pull/34228/merge
Domas 4 years ago committed by GitHub
parent bd4afe41ba
commit 815603dc19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      public/app/features/alerting/unified/RuleEditor.tsx

@ -22,7 +22,7 @@ const ExistingRuleEditor: FC<ExistingRuleEditorProps> = ({ identifier }) => {
useCleanup((state) => state.unifiedAlerting.ruleForm.existingRule);
const { loading, result, error, dispatched } = useUnifiedAlertingSelector((state) => state.ruleForm.existingRule);
const dispatch = useDispatch();
const { isEditable, loading: loadingEditableStatus } = useIsRuleEditable(result?.rule);
const { isEditable } = useIsRuleEditable(result?.rule);
useEffect(() => {
if (!dispatched) {
@ -30,7 +30,7 @@ const ExistingRuleEditor: FC<ExistingRuleEditorProps> = ({ identifier }) => {
}
}, [dispatched, dispatch, identifier]);
if (loading || loadingEditableStatus) {
if (loading || isEditable === undefined) {
return (
<Page.Contents>
<LoadingPlaceholder text="Loading rule..." />

Loading…
Cancel
Save