Skip to content

Commit 6594d54

Browse files
feat(recent-search): pass recent_limit config value to getRecentSearch function
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
1 parent 9b605de commit 6594d54

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

apps/files/src/services/Recent.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ import type { ResponseDataDetailed, SearchResult } from 'webdav'
88
import { getCurrentUser } from '@nextcloud/auth'
99
import { Folder, Permission } from '@nextcloud/files'
1010
import { getRecentSearch, getRemoteURL, getRootPath, resultToNode } from '@nextcloud/files/dav'
11+
import { loadState } from '@nextcloud/initial-state'
1112
import logger from '../logger.ts'
1213
import { getPinia } from '../store/index.ts'
1314
import { useUserConfigStore } from '../store/userconfig.ts'
1415
import { client } from './WebdavClient.ts'
1516

1617
const lastTwoWeeksTimestamp = Math.round((Date.now() / 1000) - (60 * 60 * 24 * 14))
18+
const recentLimit = loadState<number>('files', 'recent_limit', 100)
1719

1820
/**
1921
* Get recently changed nodes
@@ -41,7 +43,7 @@ export async function getContents(path = '/', options: { signal: AbortSignal }):
4143
const contentsResponse = await client.search('/', {
4244
signal: options.signal,
4345
details: true,
44-
data: getRecentSearch(lastTwoWeeksTimestamp),
46+
data: getRecentSearch(lastTwoWeeksTimestamp, recentLimit),
4547
}) as ResponseDataDetailed<SearchResult>
4648

4749
const contents = contentsResponse.data.results

dist/files-init.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-init.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)