Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Allow searching of non-radicle domains
Sebastian Martinez committed 4 years ago
commit 1a8e7d9352114ea6451286e57de89ffd0a4cd76c
parent e65ce275ac615eae1fc637333a9895b138235b0b
2 files changed +8 -13
modified src/base/resolver/Query.svelte
@@ -23,19 +23,14 @@
        // Go to Radicle project.
        navigate(`/projects/${query}`, { replace: true });
      } else {
-
        let label = utils.parseEnsLabel(query, config);
-
        if (label.includes(".")) {
-
          error = true;
+
        // Jump straight to org, if the ENS entry points to an org. Otherwise it checks if the
+
        // address type is an EOA and jumps to the user page else it just goes to the registration.
+
        const address = await utils.resolveLabel(query, config);
+
        const addressType = address && await utils.identifyAddress(address, config);
+
        if (addressType === utils.AddressType.Org || addressType === utils.AddressType.EOA) {
+
          navigate(`/${address}`, { replace: true });
        } else {
-
          // Jump straight to org, if the ENS entry points to an org. Otherwise it checks if the
-
          // address type is an EOA and jumps to the user page else it just goes to the registration.
-
          const address = await utils.resolveLabel(label, config);
-
          const addressType = address && await utils.identifyAddress(address, config);
-
          if (addressType === utils.AddressType.Org || addressType === utils.AddressType.EOA) {
-
            navigate(`/${address}`, { replace: true });
-
          } else {
-
            navigate(`/registrations/${label}`, { replace: true });
-
          }
+
          navigate(`/registrations/${query}`, { replace: true });
        }
      }
    } else {
modified src/utils.ts
@@ -312,7 +312,7 @@ export async function identifyAddress(address: string, config: Config): Promise<

// Resolve a label under the radicle domain.
export async function resolveLabel(label: string | undefined, config: Config): Promise<string | null> {
-
  if (label) return config.provider.resolveName(`${label}.${config.registrar.domain}`);
+
  if (label) return config.provider.resolveName(`${label}`);
  return null;
}