Skip to content

Commit

Permalink
add DEFAULT_NEWORK in .env.example and use it in settings.ts (#210)
Browse files Browse the repository at this point in the history
* added DEFAULT_NEWORK param in .env.example and settings.ts

* improved example

* Update .env.example

Co-authored-by: Fabien <[email protected]>
  • Loading branch information
stormsson and bonustrack authored Dec 6, 2021
1 parent 9f1026a commit fa64304
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ SERVICE_PUSH_NOTIFICATIONS=0
SERVICE_PUSHER_BEAMS_INSTANCE_ID=
SERVICE_PUSHER_BEAMS_SECRET_KEY=
SNAPSHOT_URI=http://localhost:3000
DEFAULT_NETWORK=1
4 changes: 3 additions & 1 deletion src/writer/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { storeSettings } from '../helpers/adapters/mysql';
import { jsonParse } from '../helpers/utils';
import { spaces } from '../helpers/spaces';

const DEFAULT_NETWORK = process.env.DEFAULT_NETWORK || '1';

export async function verify(body): Promise<any> {
const msg = jsonParse(body.msg);

Expand All @@ -16,7 +18,7 @@ export async function verify(body): Promise<any> {
return Promise.reject('wrong space format');
}

const spaceUri = await snapshot.utils.getSpaceUri(msg.space);
const spaceUri = await snapshot.utils.getSpaceUri(msg.space, DEFAULT_NETWORK);
const isOwner = spaceUri.includes(body.address);
const admins = (spaces[msg.space]?.admins || []).map(admin =>
admin.toLowerCase()
Expand Down

0 comments on commit fa64304

Please sign in to comment.