From 67c7b37a85955fc37827403c570446fe90b7d9b7 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Mon, 31 Oct 2022 07:06:45 -0500 Subject: Modify: username checking for playlist editor form --- playlist.lisp | 17 +++++++++++------ 1 file 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)))))) -- cgit v1.2.3