diff options
author | Colin Okay <colin@cicadas.surf> | 2022-10-31 07:06:45 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-10-31 07:06:45 -0500 |
commit | 67c7b37a85955fc37827403c570446fe90b7d9b7 (patch) | |
tree | 362378b35b54dc95e5454f60715ec23ed711b41e /playlist.lisp | |
parent | 202f3e1cabb5b8e7e8812d418d53dbeac32c4d1a (diff) |
Modify: username checking for playlist editor form
Diffstat (limited to 'playlist.lisp')
-rw-r--r-- | playlist.lisp | 17 |
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)))))) |