Skip to content

Commit adf8900

Browse files
authored
fix: Remove https from domain and default delegationNetwork to mainnet (#459)
* fix: Remove https from domain and default delegationNetwork to mainnet * add back validation * Update src/helpers/actions.ts
1 parent 591acfa commit adf8900

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/helpers/actions.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ import { DEFAULT_NETWORK_ID, jsonParse, NETWORK_ID_WHITELIST } from './utils';
44

55
export async function addOrUpdateSpace(space: string, settings: any) {
66
if (!settings?.name) return false;
7+
if (settings.domain) {
8+
settings.domain = settings.domain?.replace(/(^\w+:|^)\/\//, '').replace(/\/$/, '');
9+
}
10+
if (settings.delegationPortal) {
11+
settings.delegationPortal = {
12+
...settings.delegationPortal,
13+
delegationNetwork: settings.delegationPortal.delegationNetwork ?? '1'
14+
};
15+
}
716

817
const ts = (Date.now() / 1e3).toFixed();
918
const query =

0 commit comments

Comments
 (0)