Skip to content

Commit 724dbea

Browse files
committed
featured apps
1 parent dca1593 commit 724dbea

File tree

4 files changed

+61
-2
lines changed

4 files changed

+61
-2
lines changed

src/models/FeaturedApp.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export default class FeaturedApp {
33
this.applink = '';
44
this.img = '';
55
this.name = '';
6+
this.url = '';
67
this.text = '';
78
this.colors = null;
89
}
@@ -11,4 +12,4 @@ export default class FeaturedApp {
1112
static fromJson(json){
1213
return Object.assign(this.placeholder(), json);
1314
}
14-
}
15+
}

src/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ routes.get('/apps', async (req, res) => {
208208
});
209209

210210
routes.get('/apps/featured', async (req, res) => {
211-
returnResult(await AppService.getFeatured(), req, res);
211+
returnResult(await AppService.getFeaturedApps(), req, res);
212212
});
213213

214214
routes.post('/apps', async (req, res) => {

src/services/AppService.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,61 @@ export default class AppService {
174174
]
175175
}
176176

177+
static async getFeaturedApps(){
178+
return await Promise.all([
179+
{
180+
applink:'eosbet.io',
181+
img:'https://get-scatter.com/promos/eosbet.io.jpg',
182+
url:'https://eosbet.io/?ref=scatterrefer&utm_campaign=eos%20bet%20standard',
183+
},
184+
{
185+
applink:'dappspinach.io',
186+
img:'https://get-scatter.com/promos/dappspinach.io.jpg',
187+
url:'https://dappspinach.io/dapp/pc/dist/?channel=scat&utm_campaign=spinach+standard',
188+
},
189+
{
190+
applink:'mycryptovegas.io',
191+
img:'https://get-scatter.com/promos/mycryptovegas.jpg',
192+
url:'https://mycryptovegas.io/?ref=354625577968&utm_campaign=crypto+vegas+slot+wars',
193+
},
194+
{
195+
applink:'hirevibes.io',
196+
img:'https://get-scatter.com/promos/hirevibes.jpg',
197+
url:'https://www.hirevibes.io/?utm_campaign=hirevibes+standard',
198+
},
199+
{
200+
applink:'prospectors.io',
201+
img:'https://get-scatter.com/promos/prospectors.jpg',
202+
url:'https://prospectors.io?ref=scatterrefer&utm_campaign=prospectors+standard',
203+
},
204+
{
205+
applink:'cryptomaniaslots.com',
206+
img:'https://get-scatter.com/promos/cryptomania.jpg',
207+
url:'https://cryptomaniaslots.com/?ref=scatterrefer&utm_source=scatter.com/apps&utm_medium=banner&utm_campaign=blck',
208+
},
209+
{
210+
applink:'bethash.io',
211+
img:'https://get-scatter.com/promos/bethash.jpg',
212+
url:'https://bethash.io/?ref=scatterrefer&utm_campaign=bethash+standard',
213+
},
214+
{
215+
applink:'trustdice.win',
216+
img:'https://get-scatter.com/promos/trustdice.win.jpg',
217+
url:'https://trustdice.win/faucet?coinbox&ref=scatterrefer&utm_campaign=trustdice+standard',
218+
},
219+
{
220+
applink:'dice.one',
221+
img:'https://get-scatter.com/promos/dice.one.jpg',
222+
url:'https://dice.one/?ref=scatterrefer&utm_campaign=dice+standard',
223+
}
224+
].map(async x => {
225+
let meta = await AppService.findApp(x.applink);
226+
if(meta){
227+
meta = Object.assign(meta, x);
228+
} else meta = x;
229+
230+
return FeaturedApp.fromJson(meta);
231+
}))
232+
}
233+
177234
}

src/services/VersionService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default class VersionService {
5555
gzip: true
5656
}).then(x => x.json()).then(async res => {
5757
if(res.prerelease) return null;
58+
if(!res.assets) return null;
5859

5960
const getAsset = needle => res.assets.find(x => x.name.indexOf(needle) > -1) || {url:'#'};
6061
const getDownloadUrl = url => fetch(url).then(x => x.json()).then(x => x.browser_download_url).catch(() => '');

0 commit comments

Comments
 (0)