Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

chore: restore the ability to disable tracking request history

jamesgeorge00786ea3e427c75
diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json
index 399ae8d45..b8f430a5c 100644
--- a/packages/hoppscotch-common/locales/en.json
+++ b/packages/hoppscotch-common/locales/en.json
@@ -1132,6 +1132,7 @@
"create_new": "Create new workspace",
"deleted": "Workspace deleted",
"delete_all_activity_logs": "Delete all activity logs",
+ "successfully_deleted_all_activity_logs": "Successfully deleted all activity logs",
"delete_activity_log": "Delete activity log",
"deleted_activity_log": "Deleted selected activity log",
"deleted_all_activity_logs": "Deleted all activity logs",
diff --git a/packages/hoppscotch-common/src/components/history/Personal.vue b/packages/hoppscotch-common/src/components/history/Personal.vue
index ff2187bf5..551e96892 100644
--- a/packages/hoppscotch-common/src/components/history/Personal.vue
+++ b/packages/hoppscotch-common/src/components/history/Personal.vue
@@ -50,7 +50,11 @@
<HoppButtonSecondary
v-tippy="{ theme: 'tooltip' }"
data-testid="clear_history"
- :disabled="history.length === 0"
+ :disabled="
+ history.length === 0 ||
+ !isHistoryStoreEnabled ||
+ isFetchingHistoryStoreStatus
+ "
:icon="IconTrash2"
:title="t('action.clear_all')"
@click="confirmRemove = true"
@@ -58,7 +62,10 @@
</div>
</div>
</div>
- <div class="flex flex-col">
+ <div
+ v-if="isHistoryStoreEnabled && !isFetchingHistoryStoreStatus"
+ class="flex flex-col"
+ >
<details
v-for="(
filteredHistoryGroup, filteredHistoryGroupIndex
@@ -109,7 +116,13 @@
</details>
</div>
<HoppSmartPlaceholder
- v-if="history.length === 0"
+ v-if="!isHistoryStoreEnabled && !isFetchingHistoryStoreStatus"
+ :src="`/images/states/${colorMode.value}/time.svg`"
+ :alt="`${t('empty.history')}`"
+ :text="t('settings.history_disabled')"
+ />
+ <HoppSmartPlaceholder
+ v-else-if="history.length === 0"
:src="`/images/states/${colorMode.value}/time.svg`"
:alt="`${t('empty.history')}`"
:text="t('empty.history')"
@@ -179,6 +192,7 @@ import HistoryGraphqlCard from "./graphql/Card.vue"
import { defineActionHandler, invokeAction } from "~/helpers/actions"
import { useService } from "dioc/vue"
import { RESTTabService } from "~/services/tab/rest"
+import { platform } from "~/platform"
type HistoryEntry = GQLHistoryEntry | RESTHistoryEntry
@@ -204,6 +218,15 @@ const history = useReadonlyStream<RESTHistoryEntry[] | GQLHistoryEntry[]>(
[]
)
+const { isHistoryStoreEnabled, isFetchingHistoryStoreStatus } =
+ "requestHistoryStore" in platform.sync.history &&
+ platform.sync.history.requestHistoryStore
+ ? platform.sync.history.requestHistoryStore
+ : {
+ isHistoryStoreEnabled: ref(true),
+ isFetchingHistoryStoreStatus: ref(false),
+ }
+
const deepCheckForRegex = (value: unknown, regExp: RegExp): boolean => {
if (value === null || value === undefined) return false