From 8921eb20de34eb30477f41c77922165f92906268 Mon Sep 17 00:00:00 2001 From: saturn Date: Wed, 1 Mar 2023 22:45:06 -0600 Subject: [PATCH] Remove agree/disagree vote totals which no longer work due to API change. --- lw2.lisp | 5 ++--- src/data-viewers/comment.lisp | 3 +-- src/interface-utils.lisp | 50 +++++++++++++++---------------------------- src/lw2-login.lisp | 2 +- 4 files changed, 21 insertions(+), 39 deletions(-) diff --git a/lw2.lisp b/lw2.lisp index 520e8de0..30a0c28c 100644 --- a/lw2.lisp +++ b/lw2.lisp @@ -1387,15 +1387,14 @@ signaled condition to *HTML-OUTPUT*." (let ((vote (safe-decode-json vote-json))) (multiple-value-bind (current-vote result) (do-lw2-vote auth-token target-type target vote) - (alist-bind (vote-count base-score af af-base-score extended-score all-votes) result + (alist-bind (vote-count base-score af af-base-score extended-score) result (let ((vote-buttons (vote-buttons base-score :as-text t :af-score (and af af-base-score) :vote-count (+ vote-count (if (member (cdr (assoc :karma current-vote)) '(nil "neutral") :test #'equal) 0 1)) - :extended-score extended-score - :all-votes all-votes)) + :extended-score extended-score)) (out (make-hash-table))) (loop for (axis . axis-vote) in current-vote do (setf (gethash axis out) (list* axis-vote (gethash axis vote-buttons)))) diff --git a/src/data-viewers/comment.lisp b/src/data-viewers/comment.lisp index c1d79152..b6bdf129 100644 --- a/src/data-viewers/comment.lisp +++ b/src/data-viewers/comment.lisp @@ -20,7 +20,6 @@ (af-base-score (or null fixnum)) (vote-count (or null fixnum)) (extended-score list) - (all-votes list :subfields (:vote-type :extended-vote-type)) (page-url (or null string) :context-not :user-index) ; page-url sometimes causes "Cannot read property '_id' of undefined" error (parent-comment list :backend-type backend-lw2-tags-comments :context :index :subfields (:--id :user-id :post-id (:tag :--id :name :slug))) (parent-comment list :context :index :subfields (:--id :user-id :post-id)) @@ -71,7 +70,7 @@ ) (safe pretty-time) (safe (pretty-time-js)) (when replied ) - (vote-buttons base-score :with-buttons *enable-voting* :vote-count vote-count :af-score (and af af-base-score) :extended-score extended-score :all-votes all-votes) + (vote-buttons base-score :with-buttons *enable-voting* :vote-count vote-count :af-score (and af af-base-score) :extended-score extended-score) (when af AF) (when post-id