Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Qmaps 2414 no refresh #1247

Merged
merged 4 commits into from
Jan 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/components/ui/Suggest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { useConfig, useDevice, useI18n } from 'src/hooks';
import SuggestsDropdown from 'src/components/ui/SuggestsDropdown';
import { fetchSuggests, getInputValue, modifyList } from 'src/libs/suggest';
import { UserFeedbackYesNo } from './index';
import { getHistoryPrompt, setHistoryPrompt, setHistoryEnabled } from 'src/adapters/search_history';
import {
getHistoryPrompt,
setHistoryPrompt,
setHistoryEnabled,
getHistoryEnabled,
} from 'src/adapters/search_history';
import { Box, Button, Stack, Text } from '@qwant/qwant-ponents';
import { PURPLE } from '../../libs/colors';
import { IconHistory, IconHistoryDisabled, IconMenu } from './icons';
Expand Down Expand Up @@ -213,6 +218,9 @@ const Suggest = ({
currentQuery.abort();
}

// Check if history has been enabled in the current session before fetching suggest items
withHistory = getHistoryEnabled();

const query = fetchSuggests(value, {
withCategories,
...getSuggestItemLimits({ inputValue: value, withHistory, isMobile }),
Expand Down