Move autoflush calls

This commit is contained in:
Frederic Guillot 2017-01-15 16:18:58 -05:00
parent 898dd9bea2
commit 2aba596785
2 changed files with 6 additions and 5 deletions

View File

@ -50,6 +50,12 @@ Router\before(function ($action) {
if (ENABLE_HSTS && Helper\is_secure_connection()) { if (ENABLE_HSTS && Helper\is_secure_connection()) {
Response\hsts(); Response\hsts();
} }
if (SessionStorage::getInstance()->isLogged()) {
$user_id = SessionStorage::getInstance()->getUserId();
Model\Item\autoflush_read($user_id);
Model\Item\autoflush_unread($user_id);
}
}); });
// Image proxy (avoid SSL mixed content warnings) // Image proxy (avoid SSL mixed content warnings)

View File

@ -13,11 +13,6 @@ use Miniflux\Model;
// Display unread items // Display unread items
Router\get_action('unread', function () { Router\get_action('unread', function () {
$user_id = SessionStorage::getInstance()->getUserId();
Model\Item\autoflush_read($user_id);
Model\Item\autoflush_unread($user_id);
$params = items_list(Model\Item\STATUS_UNREAD); $params = items_list(Model\Item\STATUS_UNREAD);
if ($params['nb_unread_items'] === 0) { if ($params['nb_unread_items'] === 0) {