MCPcopy Create free account
hub / github.com/TheJoWo/Clean-Clode / toggleHistory

Function toggleHistory

script.js:139–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 }
138
139 function toggleHistory() {
140 const currentlyEnabled = isHistoryEnabled();
141 const willEnable = !currentlyEnabled;
142
143 const message = willEnable
144 ? 'Enable paste history? Your cleaned text will be stored locally on this device.'
145 : 'Disable paste history? This will permanently delete all existing history and stop saving new items.';
146
147 if (!confirm(message)) {
148 return;
149 }
150
151 if (!willEnable) {
152 try {
153 localStorage.removeItem(HISTORY_KEY);
154 } catch (error) {
155 }
156 }
157
158 localStorage.setItem(HISTORY_ENABLED_KEY, willEnable.toString());
159 updateHistoryUI();
160 updateHistoryDisplay();
161 updateHistoryVisibility();
162
163 }
164
165 function updateHistoryUI() {
166 const enabled = isHistoryEnabled();

Callers

nothing calls this directly

Calls 4

isHistoryEnabledFunction · 0.85
updateHistoryUIFunction · 0.85
updateHistoryDisplayFunction · 0.85
updateHistoryVisibilityFunction · 0.85

Tested by

no test coverage detected