From a2e8fa65105b8415b6f4ee878fef24a1ac5b17f1 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 11 Jan 2018 21:16:06 -0700 Subject: [PATCH] Add allowOlder opt to setFileBaseLastViewdFileIdForUser() --- core/file_base_filter.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/file_base_filter.js b/core/file_base_filter.js index a7185316..320d36d3 100644 --- a/core/file_base_filter.js +++ b/core/file_base_filter.js @@ -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); }