Skip to content

Commit

Permalink
avoid sending an unnecessary request if snooze data is found in rules…
Browse files Browse the repository at this point in the history
… table context
  • Loading branch information
maximpn committed Apr 24, 2023
1 parent b98ad2b commit b70f92b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function useRuleSnoozeSettings(id: string): UseRuleSnoozeSettingsResult {
data: rulesSnoozeSettings,
isFetching: isSingleSnoozeSettingsFetching,
isError: isSingleSnoozeSettingsError,
} = useFetchRulesSnoozeSettings([id]);
} = useFetchRulesSnoozeSettings([id], { enabled: !rulesTableSnoozeSettings?.data[id] });
const snoozeSettings = rulesTableSnoozeSettings?.data[id] ?? rulesSnoozeSettings?.[0];
const isFetching = rulesTableSnoozeSettings?.isFetching || isSingleSnoozeSettingsFetching;
const isError = rulesTableSnoozeSettings?.isError || isSingleSnoozeSettingsError;
Expand Down

0 comments on commit b70f92b

Please sign in to comment.