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

Commit

Permalink
QMAPS-2414 display history items without having to refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
xem committed Jan 25, 2022
1 parent 5780326 commit b5e4c54
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit b5e4c54

Please sign in to comment.