<commit_before>(ns name-bazaar.ui.subs.watched-names-subs
  (:require
    [medley.core :as medley]
    [re-frame.core :refer [reg-sub subscribe]]))

(reg-sub
  :watched-names
  (fn [db]
    (:watched-names db)))

(reg-sub
  :watched-names/watched-items
  :<- [:watched-names]
  :<- [:ens/records]
  (fn [[watched-names ens-records]]
    (map (fn [node]
           (let [{:keys [:ens.record/name] :as watched-ens-record} (get-in watched-names [:ens/records node])]
             (merge
               watched-ens-record
               {:ens.record/node node})))
         (:order watched-names))))

(reg-sub
  :watched-names.node/watched?
  :<- [:watched-names]
  (fn [watched-names [_ node]]
    (boolean (get-in watched-names [:ens/records node]))))
<commit_msg>Fix name display in watched names<commit_after>(ns name-bazaar.ui.subs.watched-names-subs
  (:require
    [medley.core :as medley]
    [re-frame.core :refer [reg-sub subscribe]]))

(reg-sub
  :watched-names
  (fn [db]
    (:watched-names db)))

(reg-sub
  :watched-names/watched-items
  :<- [:watched-names]
  :<- [:ens/records]
  :<- [:offerings]
  (fn [[watched-names ens-records offerings]]
    (map (fn [node]
           (let [{:keys [:ens.record/name] :as watched-ens-record} (get-in watched-names [:ens/records node])]
             (merge
               watched-ens-record
               {:ens.record/node node}
               (if-let [offering-address (get-in ens-records [node :ens.record/active-offering])]
                 (get offerings offering-address)))))
         (:order watched-names))))

(reg-sub
  :watched-names.node/watched?
  :<- [:watched-names]
  (fn [watched-names [_ node]]
    (boolean (get-in watched-names [:ens/records node]))))

{'fraction_non_alphanumeric': 0.17965116279069768, 'fraction_numerical': 0.0, 'mean_word_length': 2.623157894736842, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1453057', 'n_tokens_mistral': 638, 'n_tokens_neox': 621, 'n_words': 120}