diff --git a/src/app/hooks/useAccountName.ts b/src/app/hooks/useAccountName.ts index 76b1a5a441..ecdb3c3d05 100644 --- a/src/app/hooks/useAccountName.ts +++ b/src/app/hooks/useAccountName.ts @@ -1,4 +1,5 @@ import { SearchScope } from '../../types/searchScope' +import Chance from 'chance' const NO_MATCH = '__no_match__' @@ -7,6 +8,11 @@ type AccountNameInfo = { loading: boolean } +/** + * Do we want to see some random names? + */ +const DEBUG_MODE = false + /** * Look up the name of an account. */ @@ -14,7 +20,8 @@ const lookupName = (scope: SearchScope, _address: string): string | undefined => switch (scope.layer) { // TODO: look up the data default: - return undefined + // If debug mode is on, return mock names in ~50% of the cases, no nome otherwise + return DEBUG_MODE && Math.random() < 0.5 ? new Chance().name() : undefined } }