From 57803263fb523bfd4648463df8e8fff8dcf74055 Mon Sep 17 00:00:00 2001 From: xem Date: Mon, 24 Jan 2022 11:24:59 +0100 Subject: [PATCH 1/4] QMAPS-2440 fix links --- src/components/ui/Suggest.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ui/Suggest.jsx b/src/components/ui/Suggest.jsx index d47a7c225..dac614d97 100644 --- a/src/components/ui/Suggest.jsx +++ b/src/components/ui/Suggest.jsx @@ -163,7 +163,7 @@ const Suggest = ({ className="historyParagraph" dangerouslySetInnerHTML={{ __html: _( - 'You can find and manage your complete history at any time in the menu', + 'You can find and manage your complete history at any time in the menu.', 'history' ), }} @@ -187,7 +187,7 @@ const Suggest = ({ className="historyParagraph" dangerouslySetInnerHTML={{ __html: _( - 'You can change your mind at any time and manage the activation of the history in the menu', + 'You can change your mind at any time and manage the activation of the history in the menu.', 'history' ), }} From b5e4c54dda0c1ff940ccc03b68e51f8b3e5e80c9 Mon Sep 17 00:00:00 2001 From: xem Date: Tue, 25 Jan 2022 16:48:41 +0100 Subject: [PATCH 2/4] QMAPS-2414 display history items without having to refresh --- src/components/ui/Suggest.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/ui/Suggest.jsx b/src/components/ui/Suggest.jsx index dac614d97..4ede98b3f 100644 --- a/src/components/ui/Suggest.jsx +++ b/src/components/ui/Suggest.jsx @@ -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'; @@ -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 }), From ddc86dd91d001172d469978313beb775385fbe0a Mon Sep 17 00:00:00 2001 From: xem Date: Tue, 25 Jan 2022 16:56:36 +0100 Subject: [PATCH 3/4] QMAPS-2414 display history items without having to refresh --- src/components/ui/Suggest.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ui/Suggest.jsx b/src/components/ui/Suggest.jsx index 4ede98b3f..0287cc244 100644 --- a/src/components/ui/Suggest.jsx +++ b/src/components/ui/Suggest.jsx @@ -168,7 +168,7 @@ const Suggest = ({ className="historyParagraph" dangerouslySetInnerHTML={{ __html: _( - 'You can find and manage your complete history at any time in the menu.', + 'You can find and manage your complete history at any time in the menu.', 'history' ), }} @@ -192,7 +192,7 @@ const Suggest = ({ className="historyParagraph" dangerouslySetInnerHTML={{ __html: _( - 'You can change your mind at any time and manage the activation of the history in the menu.', + 'You can change your mind at any time and manage the activation of the history in the menu.', 'history' ), }} From f2dccf3a38af7b2536afba9ad3b7c2af7837f4a6 Mon Sep 17 00:00:00 2001 From: xem Date: Tue, 25 Jan 2022 16:57:28 +0100 Subject: [PATCH 4/4] QMAPS-2414 display history items without having to refresh --- src/components/ui/Suggest.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ui/Suggest.jsx b/src/components/ui/Suggest.jsx index 0287cc244..5ea5f361e 100644 --- a/src/components/ui/Suggest.jsx +++ b/src/components/ui/Suggest.jsx @@ -168,7 +168,7 @@ const Suggest = ({ className="historyParagraph" dangerouslySetInnerHTML={{ __html: _( - 'You can find and manage your complete history at any time in the menu.', + 'You can find and manage your complete history at any time in the menu', 'history' ), }} @@ -192,7 +192,7 @@ const Suggest = ({ className="historyParagraph" dangerouslySetInnerHTML={{ __html: _( - 'You can change your mind at any time and manage the activation of the history in the menu.', + 'You can change your mind at any time and manage the activation of the history in the menu', 'history' ), }}