Skip to content

Commit b59baa2

Browse files
committed
feat: enhance history management by adding 'historyEnabled' checks in relevant functions
1 parent bb1644a commit b59baa2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

public/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@
760760
}
761761

762762
function persistHistory(entries) {
763-
if (typeof window === 'undefined' || typeof window.localStorage === 'undefined') return;
763+
if (typeof window === 'undefined' || typeof window.localStorage === 'undefined' || historyEnabled === false) return;
764764
try {
765765
window.localStorage.setItem(HISTORY_STORAGE_KEY, JSON.stringify(entries));
766766
} catch (error) {
@@ -975,7 +975,7 @@
975975
}
976976

977977
function addConversationToHistory(sessionUuid, prompt, data) {
978-
if (typeof window === 'undefined' || !sessionUuid) return null;
978+
if (typeof window === 'undefined' || !sessionUuid || historyEnabled === false) return null;
979979

980980
const entries = loadStoredHistory();
981981
const existingIndex = entries.findIndex(item => item.uuid === sessionUuid);
@@ -1330,7 +1330,7 @@
13301330
__refreshDarkMode();
13311331

13321332
if (data.status === 'finished') {
1333-
if (currentSessionUuid) {
1333+
if (currentSessionUuid && historyEnabled !== false) {
13341334
const savedEntry = addConversationToHistory(currentSessionUuid, lastSubmittedPrompt, data);
13351335
if (savedEntry) {
13361336
activeHistoryId = savedEntry.id;

0 commit comments

Comments
 (0)