diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-07-15 08:43:16 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-07-15 08:43:16 -0400 |
commit | 9ad3988802ff3f20cc592ea2d683be8fcea52f5a (patch) | |
tree | 6ab0377788e615a981bf9d4eb7635aa58bd04003 /src | |
parent | 4822a5f4c0c9b230863b5a68f4aa890136e11c7b (diff) |
remember instance choice for prompt
Diffstat (limited to 'src')
-rw-r--r-- | src/lemmold/core.clj | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lemmold/core.clj b/src/lemmold/core.clj index ab366d4..b235924 100644 --- a/src/lemmold/core.clj +++ b/src/lemmold/core.clj @@ -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.") |