Skip to content

Commit 395efc7

Browse files
authored
fix: display query settings banner for non-default api call or txmode (#2152)
1 parent 24a34f8 commit 395efc7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/utils/hooks/useChangedQuerySettings.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ export const useChangedQuerySettings = () => {
1414
const [lastQuerySettings] = useLastQueryExecutionSettings();
1515
const [currentQuerySettings] = useQueryExecutionSettings();
1616

17-
const changedLastExucutionSettings = lastQuerySettings
17+
const changedLastExecutionSettings = lastQuerySettings
1818
? getChangedQueryExecutionSettings(lastQuerySettings, DEFAULT_QUERY_SETTINGS)
1919
: [];
2020

2121
const changedCurrentSettings = currentQuerySettings
2222
? getChangedQueryExecutionSettings(currentQuerySettings, DEFAULT_QUERY_SETTINGS)
2323
: [];
2424

25-
const hasChangedLastExucutionSettings = changedLastExucutionSettings.length > 0;
25+
const hasChangedImportantSettings =
26+
changedLastExecutionSettings.includes('transactionMode') ||
27+
changedLastExecutionSettings.includes('queryMode');
2628

2729
const changedLastExecutionSettingsDescriptions = lastQuerySettings
2830
? getChangedQueryExecutionSettingsDescription({
@@ -42,23 +44,21 @@ export const useChangedQuerySettings = () => {
4244
bannerLastClosedTimestamp &&
4345
Date.now() - bannerLastClosedTimestamp < WEEK_IN_SECONDS * 1000;
4446

45-
const isBannerShown = hasChangedLastExucutionSettings && !isClosedRecently;
46-
const isIndicatorShown = hasChangedLastExucutionSettings && isClosedRecently;
47+
const isBannerShown = hasChangedImportantSettings && !isClosedRecently;
4748

4849
const closeBanner = () => setBannerLastClosedTimestamp(Date.now());
4950

5051
const resetBanner = () => setBannerLastClosedTimestamp(undefined);
5152

5253
return {
5354
isBannerShown,
54-
isIndicatorShown,
5555
closeBanner,
5656
resetBanner,
5757

5858
changedCurrentSettings,
5959
changedCurrentSettingsDescriptions,
6060

61-
changedLastExucutionSettings,
61+
changedLastExecutionSettings,
6262
changedLastExecutionSettingsDescriptions,
6363
};
6464
};

0 commit comments

Comments
 (0)