remember instance choice for prompt

master
Clyne 1 year ago
parent 4822a5f4c0
commit 9ad3988802
Signed by: clyne
GPG Key ID: 1B74EE6C49C96795

@ -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.")

Loading…
Cancel
Save