diff --git a/client/src/stores/historyStore.ts b/client/src/stores/historyStore.ts index 49ec6b45e04..8286c20fd97 100644 --- a/client/src/stores/historyStore.ts +++ b/client/src/stores/historyStore.ts @@ -68,26 +68,13 @@ export const useHistoryStore = defineStore("historyStore", () => { const getHistoryById = computed(() => { return (historyId: string) => { if (!storedHistories.value[historyId]) { - // Create a placeholder to avoid multiple requests for the same history - // and reuse the reference to avoid reactivity issues - storedHistories.value[historyId] = createHistoryPlaceholder(historyId); - // TODO: Try to remove this as it can cause computed side effects loadHistoryById(historyId); } - return storedHistories.value[historyId]!; + return storedHistories.value[historyId] ?? null; }; }); - function createHistoryPlaceholder(historyId: string) { - const history = { - id: historyId, - name: "Loading...", - contents_active: { active: 0, deleted: 0, hidden: 0 }, - } as AnyHistory; - return history; - } - const getHistoryNameById = computed(() => { return (historyId: string) => { const history = getHistoryById.value(historyId);