diff of e3f11066657613c7312f64b3581d0b7ab30dbbb0
e3f11066657613c7312f64b3581d0b7ab30dbbb0
diff --git a/src/view/components/tabs.lisp b/src/view/components/tabs.lisp
index f1039d7..66b5e09 100644
--- a/src/view/components/tabs.lisp
+++ b/src/view/components/tabs.lisp
@@ -66,26 +66,28 @@
,params
(values (quote ,sym) (list ,@captured-url-params)))))
-(defun tab-container (selected-tab tablist tab-parameters)
+(defun tab-container (selected-tab tablist* tab-parameters)
(assert (is-tab? selected-tab))
- (assert (every #'is-tab? tablist))
-
- (sort tablist (lambda (a b)
- (string-lessp (title a) (title b))))
-
- (with-html
- (:div.tabs :id "topbar"
- (:ul.tab-headers
- (dolist (tab tablist)
- (unless (subtab tab)
- (:li :class (format nil "tab-header ~a" (if (equalp tab selected-tab)
- "tab-selected"
- ""))
- ;; wonder if this is actually necessary or just an artifact of the old newui branch?
- :data-href (tab-url tab)
- (:a :href (tab-url tab)
- (title tab))))))
- (apply (tab-component selected-tab) tab-parameters))))
+ (assert (every #'is-tab? tablist*))
+
+ (let ((tablist (sort (copy-list tablist*)
+ (lambda (a b)
+ (string-lessp (title a) (title b))))))
+ (assert (equalp (length tablist*) (length tablist)))
+
+ (with-html
+ (:div.tabs :id "topbar"
+ (:ul.tab-headers
+ (dolist (tab tablist)
+ (unless (subtab tab)
+ (:li :class (format nil "tab-header ~a" (if (equalp tab selected-tab)
+ "tab-selected"
+ ""))
+ ;; wonder if this is actually necessary or just an artifact of the old newui branch?
+ :data-href (tab-url tab)
+ (:a :href (tab-url tab)
+ (title tab))))))
+ (apply (tab-component selected-tab) tab-parameters)))))
(defun @dispatcher (next inject-to-head)