Просмотр исходного кода

fixed: Shortcuts in "Anonym. Mode" broken (#3897) (#3945)

* fix

* improved delayClick()

* Do not send empty mark as read request

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
maTh 4 лет назад
Родитель
Сommit
387343a0e1
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      p/scripts/main.js

+ 6 - 0
p/scripts/main.js

@@ -201,6 +201,12 @@ const pending_entries = {};
 let mark_read_queue = [];
 
 function send_mark_read_queue(queue, asRead, callback) {
+	if (!queue || queue.length === 0) {
+		if (callback) {
+			callback();
+		}
+		return;
+	}
 	const req = new XMLHttpRequest();
 	req.open('POST', '.?c=entry&a=read' + (asRead ? '' : '&is_read=0'), true);
 	req.responseType = 'json';