(projectId: string, messageId: string)
| 191 | } |
| 192 | |
| 193 | export 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 | |
| 207 | export function hasClickedOverleafComment(projectId: string, messageId: string): boolean { |
| 208 | if (!projectId || !messageId) return false; |
no test coverage detected