Skip to content

Commit

Permalink
allow minus symbols for ens names
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Winkler committed Jul 3, 2019
1 parent 4f63f7b commit e43d7ac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

### Deprecations

## Version 2.2.1
### Fixes
- allow minus symbols for ens names


## Version 2.2.0
### Fixes
- load dev domain from localStorage `evan-dev-dapps-domain` or from `queryParams.dev-domain`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@
"serve": "gulp --cwd . --gulpfile gulp/serve.js serve",
"serve-build": "gulp --cwd . --gulpfile gulp/serve.js serve --build"
},
"version": "2.2.0"
"version": "2.2.1"
}
2 changes: 1 addition & 1 deletion src/app/dapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function getVersionDBCPHashFromDAppVersion(requiredVersion: string, childENS: st
if (childDefinition && childDefinition) {
const originalVersion = requiredVersion;
const childVersions = childDefinition.versions || { };
childVersions[childDefinition.version] = childENS.replace(/-/g, '');
childVersions[childDefinition.version] = childENS;

const versionKeys = Object.keys(childVersions);
const splittedVersion = getSplittedVersion(requiredVersion);
Expand Down
4 changes: 2 additions & 2 deletions src/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function setUpDevMode(): Promise<void> {
*/
export function isDevAvailable(name): boolean {
if (evanGlobals.devMode) {
return evanGlobals.devMode.indexOf(name.replace(/\-/g, '')) !== -1;
return evanGlobals.devMode.indexOf(name) !== -1;
}

return false;
Expand Down Expand Up @@ -219,7 +219,7 @@ export async function onDeviceReady(): Promise<any> {
* @return {string} dappname including sub ens paths
*/
export function getDAppName(ensAddress: string) {
let dappName = ensAddress.replace(/\-/g, '');
let dappName = ensAddress;

try {
dappName = /^(.*)\.[^.]+$/.exec(dappName)[1];
Expand Down
4 changes: 2 additions & 2 deletions src/systemjs-plugins/ens.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ try {
*/
const getDefinitionFromEns = function(ensAddress, domain) {
// remove domain from the end of the ensAddress to get the dapp name
let dappName = ensAddress.replace(/\-/g, '').split('.');
let dappName = ensAddress.split('.');
dappName = dappName.slice(0, dappName.length - 1).join('.');

// get correct ens address and check if a cached ens is availabled
const validEnsAddress = ensAddress.replace(/-/g, '');
const validEnsAddress = ensAddress;
const cacheAvailable = ensCache[validEnsAddress] && ensCache[validEnsAddress] !== 'invalid';

// loading chain used to reload the ens data after 3 seconds, when cached
Expand Down

0 comments on commit e43d7ac

Please sign in to comment.