mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 22:36:49 +01:00
getOrCreateUser already checks for Hex64. No need to do it twice
This commit is contained in:
@@ -297,12 +297,7 @@ object LocalCache : ILocalCache {
|
|||||||
observablesByKindAndAuthor[event.kind]?.get(event.pubKey)?.updateIfMatches(event)
|
observablesByKindAndAuthor[event.kind]?.get(event.pubKey)?.updateIfMatches(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun checkGetOrCreateUser(key: String): User? {
|
fun checkGetOrCreateUser(key: String): User? = getOrCreateUser(key)
|
||||||
if (isValidHex(key)) {
|
|
||||||
return getOrCreateUser(key)
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getOrCreateUser(key: HexKey): User {
|
fun getOrCreateUser(key: HexKey): User {
|
||||||
require(isValidHex(key = key)) { "$key is not a valid hex" }
|
require(isValidHex(key = key)) { "$key is not a valid hex" }
|
||||||
|
|||||||
Reference in New Issue
Block a user