generated from nhcarrigan/template
29 lines
888 B
TypeScript
29 lines
888 B
TypeScript
// Separate module for history restoration to ensure persistence across reconnects
|
|
let shouldRestore = false;
|
|
let savedHistory: string | null = null;
|
|
|
|
export function setShouldRestoreHistory(should: boolean) {
|
|
shouldRestore = should;
|
|
console.log("Setting shouldRestoreHistory to:", should);
|
|
}
|
|
|
|
export function setSavedHistory(history: string | null) {
|
|
savedHistory = history;
|
|
console.log("Setting savedHistory, length:", history?.length || 0);
|
|
}
|
|
|
|
export function getShouldRestoreHistory(): boolean {
|
|
console.log("Getting shouldRestoreHistory:", shouldRestore);
|
|
return shouldRestore;
|
|
}
|
|
|
|
export function getSavedHistory(): string | null {
|
|
console.log("Getting savedHistory, length:", savedHistory?.length || 0);
|
|
return savedHistory;
|
|
}
|
|
|
|
export function clearHistoryRestore() {
|
|
console.log("Clearing history restore flags");
|
|
shouldRestore = false;
|
|
savedHistory = null;
|
|
} |