-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement check for account name existence in login dialog (#205)
* Implement check for account name existence in login dialog * Improve semantics of method name * Refactor duplicate finding
- Loading branch information
1 parent
aa8423c
commit d689b20
Showing
4 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
packages/IMAPClient-UI.package/ICLoginDialog.class/instance/checkIfAccountnameUnused..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
helper | ||
checkIfAccountnameUnused: aDictionary | ||
|
||
" return false if account with same name exists " | ||
ICHelper loadCredentialsIntoDictionaries | ||
detect: [:credDict | (aDictionary at: 'name') = (credDict at: 'name')] | ||
ifFound: [:credDict | self displayAccountnameExistsErrorMessage. ^false] | ||
ifNone: [^true] |
4 changes: 4 additions & 0 deletions
4
...MAPClient-UI.package/ICLoginDialog.class/instance/displayAccountnameExistsErrorMessage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
toasts | ||
displayAccountnameExistsErrorMessage | ||
|
||
UserDialogBoxMorph inform: 'This account name already exists.' title: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters