Skip to content

Node.js based forum software built for the modern web

closes #1176

barisusakli57f9f8bc5726
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 6ccb865b07..2280bb728f 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -309,7 +309,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
if (window.location.hash) {
Topic.scrollToPost(window.location.hash.substr(1), true);
- } else if (bookmark && (!config.usePagination || (config.usePagination && pagination.currentPage === 1))) {
+ } else if (bookmark && (!config.usePagination || (config.usePagination && pagination.currentPage === 1)) && Topic.postCount > 1) {
app.alert({
alert_id: 'bookmark',
message: '[[topic:bookmark_instructions]]',
@@ -1042,8 +1042,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
$('.progress-bar').width((index / Topic.postCount * 100) + '%');
var currentBookmark = localStorage.getItem('topic:' + templates.get('topic_id') + ':bookmark');
- if (!currentBookmark || parseInt(el.attr('data-pid'), 10) > parseInt(currentBookmark, 10)) {
+ if (!currentBookmark || parseInt(el.attr('data-pid'), 10) >= parseInt(currentBookmark, 10)) {
localStorage.setItem('topic:' + templates.get('topic_id') + ':bookmark', el.attr('data-pid'));
+ app.removeAlert('bookmark');
}
if (!scrollingToPost) {
diff --git a/src/database/redis.js b/src/database/redis.js
index d672994b6c..e37afff1ba 100644
--- a/src/database/redis.js
+++ b/src/database/redis.js
@@ -207,9 +207,7 @@
multi.hgetall(keys[x]);
}
- multi.exec(function (err, replies) {
- callback(err, replies);
- });
+ multi.exec(callback);
};
module.getObjectField = function(key, field, callback) {