mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-05 12:17:17 +02:00
Add allowOlder opt to setFileBaseLastViewdFileIdForUser()
This commit is contained in:
parent
30fd001db3
commit
a2e8fa6510
1 changed files with 7 additions and 2 deletions
|
@ -136,9 +136,14 @@ module.exports = class FileBaseFilters {
|
|||
return parseInt((user.properties.user_file_base_last_viewed || 0));
|
||||
}
|
||||
|
||||
static setFileBaseLastViewedFileIdForUser(user, fileId, cb) {
|
||||
static setFileBaseLastViewedFileIdForUser(user, fileId, allowOlder, cb) {
|
||||
if(!cb && _.isFunction(allowOlder)) {
|
||||
cb = allowOlder;
|
||||
allowOlder = false;
|
||||
}
|
||||
|
||||
const current = FileBaseFilters.getFileBaseLastViewedFileIdByUser(user);
|
||||
if(fileId < current) {
|
||||
if(!allowOlder && fileId < current) {
|
||||
if(cb) {
|
||||
cb(null);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue