MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / addClickedOverleafComment

Function addClickedOverleafComment

webapp/_webapp/src/libs/helpers.ts:193–205  ·  view source on GitHub ↗
(projectId: string, messageId: string)

Source from the content-addressed store, hash-verified

191}
192
193export function addClickedOverleafComment(projectId: string, messageId: string) {
194 if (!projectId || !messageId) return;
195 const key = OVERLEAF_COMMENTS_CLICKED_PREFIX + projectId;
196 let arr = getClickedOverleafComments(projectId);
197 // Deduplicate
198 arr = arr.filter((id) => id !== messageId);
199 arr.push(messageId);
200 // Maximum 200 items
201 if (arr.length > MAX_CLICKED_COMMENTS) {
202 arr = arr.slice(arr.length - MAX_CLICKED_COMMENTS);
203 }
204 storage.setItem(key, JSON.stringify(arr));
205}
206
207export function hasClickedOverleafComment(projectId: string, messageId: string): boolean {
208 if (!projectId || !messageId) return false;

Callers 1

handleAddCommentsFunction · 0.90

Calls 2

setItemMethod · 0.65

Tested by

no test coverage detected