Add allowOlder opt to setFileBaseLastViewdFileIdForUser()
This commit is contained in:
parent
30fd001db3
commit
a2e8fa6510
|
@ -136,9 +136,14 @@ module.exports = class FileBaseFilters {
|
||||||
return parseInt((user.properties.user_file_base_last_viewed || 0));
|
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);
|
const current = FileBaseFilters.getFileBaseLastViewedFileIdByUser(user);
|
||||||
if(fileId < current) {
|
if(!allowOlder && fileId < current) {
|
||||||
if(cb) {
|
if(cb) {
|
||||||
cb(null);
|
cb(null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue