Add allowOlder opt to setFileBaseLastViewdFileIdForUser()

This commit is contained in:
Bryan Ashby 2018-01-11 21:16:06 -07:00
parent 30fd001db3
commit a2e8fa6510
1 changed files with 7 additions and 2 deletions

View File

@ -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);
} }