mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Improve messages error handling (#181)
* Improve messages error handling * Add types to getPlayerFromIdentifier function * Add phone validation regex to message group form * Add correct alert types to enum * Improve locale * Improve error message for unregistered numbers
This commit is contained in:
1 parent
f27e486ff5
commit
107dc43624
9 files changed
+58
-23
No files matched your search
@@ -47,9 +47,9 @@ export async function getIdentifierByPhoneNumber(
|
||||
* Returns the player phoneNumber for a passed identifier
|
||||
* @param identifier The players phone number
|
||||
*/
|
||||
export function getPlayerFromIdentifier(identifier: string) {
|
||||
export function getPlayerFromIdentifier(identifier: string): Player | null {
|
||||
const player = PlayersByIdentifier.get(identifier);
|
||||
if (!player) mainLogger.error(`Could not find player from identifier: ${identifier}`);
|
||||
if (!player) return null;
|
||||
return player;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user