summaryrefslogtreecommitdiff
path: root/playlist.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-31 07:06:45 -0500
committerColin Okay <colin@cicadas.surf>2022-10-31 07:06:45 -0500
commit67c7b37a85955fc37827403c570446fe90b7d9b7 (patch)
tree362378b35b54dc95e5454f60715ec23ed711b41e /playlist.lisp
parent202f3e1cabb5b8e7e8812d418d53dbeac32c4d1a (diff)
Modify: username checking for playlist editor form
Diffstat (limited to 'playlist.lisp')
-rw-r--r--playlist.lisp17
1 files changed, 11 insertions, 6 deletions
diff --git a/playlist.lisp b/playlist.lisp
index 4eaba3d..281b9bf 100644
--- a/playlist.lisp
+++ b/playlist.lisp
@@ -367,7 +367,7 @@
(thunk*
(remove-editor playlist editor)
(destroy editor-elem))))))
- (set-on-key-press
+ (set-on-blur
userinput
(thunk*
(setf (text username-status)
@@ -376,11 +376,16 @@
(set-on-click
addbtn
(thunk*
- (when-let (user (user-with-name (value userinput)))
- (add-editor playlist user)
- (setf (value userinput) ""
- (text username-status) "")
- (create-editor-item user))))
+ (let ((user (user-with-name (value userinput))))
+ (cond
+ (user
+ (add-editor playlist user)
+ (setf (value userinput) ""
+ (text username-status) "")
+ (create-editor-item user))
+ (t
+ (setf (text username-status)
+ "No user with that name"))))))
(dolist (editor (playlist-editors playlist))
(create-editor-item editor))))))