Skip to content

Commit 5881ee6

Browse files
committed
add completedmin date
1 parent 0b2f72c commit 5881ee6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/backends/google-tasks-backend-chrome.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,13 @@ class GoogleTasksBackendExtension extends TaskBackend {
164164

165165
// Get tasks from all lists in parallel
166166
if (resourceTypes.includes('tasks')) {
167+
// Only fetch completed tasks from the last 24 hours to avoid hitting the 100-task limit
168+
const completedMin = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString()
169+
167170
const taskPromises = this.data.tasklists.map(
168171
async (tasklist) => {
169172
const data = await this.apiRequest(
170-
`/lists/${tasklist.id}/tasks?showCompleted=true&showHidden=true&showAssigned=true&maxResults=100`
173+
`/lists/${tasklist.id}/tasks?showCompleted=true&showHidden=true&showAssigned=true&maxResults=100&completedMin=${encodeURIComponent(completedMin)}`
171174
)
172175
// Add tasklist info to each task
173176
return (data.items || []).map((task) => ({

0 commit comments

Comments
 (0)