|
|
|
@ -102,10 +102,10 @@
|
|
|
|
|
(flush)
|
|
|
|
|
(read-line))
|
|
|
|
|
|
|
|
|
|
(defn show-instance-prompt []
|
|
|
|
|
(printf "Enter instance name [%s]: " DEFAULT-INSTANCE)
|
|
|
|
|
(defn show-instance-prompt [current]
|
|
|
|
|
(printf "Enter instance name [%s]: " current)
|
|
|
|
|
(flush)
|
|
|
|
|
(let [inst (read-line)] (if (empty? inst) DEFAULT-INSTANCE inst)))
|
|
|
|
|
(let [inst (read-line)] (if (empty? inst) current inst)))
|
|
|
|
|
|
|
|
|
|
(defn view-post
|
|
|
|
|
"Main loop for viewing a post and its comments."
|
|
|
|
@ -158,7 +158,7 @@
|
|
|
|
|
"Updates state for viewing a different instance."
|
|
|
|
|
[state]
|
|
|
|
|
(-> state
|
|
|
|
|
(assoc :instance (show-instance-prompt))
|
|
|
|
|
(assoc :instance (show-instance-prompt (:instance state)))
|
|
|
|
|
(change-community)))
|
|
|
|
|
|
|
|
|
|
(defn view-page
|
|
|
|
@ -191,7 +191,7 @@
|
|
|
|
|
(defn -main [& args]
|
|
|
|
|
(println "Welcome to lemmold, your old-school Lemmy browser!")
|
|
|
|
|
(println)
|
|
|
|
|
(let [instance (show-instance-prompt)
|
|
|
|
|
(let [instance (show-instance-prompt DEFAULT-INSTANCE)
|
|
|
|
|
community (show-community-prompt)]
|
|
|
|
|
(view-page instance community))
|
|
|
|
|
(println "Goodbye.")
|
|
|
|
|