File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -47,21 +47,19 @@ export class PreloadState extends GameState {
47
47
}
48
48
49
49
async fetchDiscounts ( ) {
50
- // Summer sale specific
51
- globalConfig . currentDiscount = 60 ;
52
-
53
- // Regular
54
- // await timeoutPromise(
55
- // fetch("https://analytics.shapez.io/v1/discounts")
56
- // .then(res => res.json())
57
- // .then(data => {
58
- // globalConfig.currentDiscount = Number(data["1318690"].data.price_overview.discount_percent);
59
- // logger.log("Fetched current discount:", globalConfig.currentDiscount);
60
- // }),
61
- // 2000
62
- // ).catch(err => {
63
- // logger.warn("Failed to fetch current discount:", err);
64
- // });
50
+ await timeoutPromise (
51
+ fetch ( "https://analytics.shapez.io/v1/discounts" )
52
+ . then ( res => res . json ( ) )
53
+ . then ( data => {
54
+ globalConfig . currentDiscount = Number (
55
+ data [ "1318690" ] . data . price_overview . discount_percent
56
+ ) ;
57
+ logger . log ( "Fetched current discount:" , globalConfig . currentDiscount ) ;
58
+ } ) ,
59
+ 2000
60
+ ) . catch ( err => {
61
+ logger . warn ( "Failed to fetch current discount:" , err ) ;
62
+ } ) ;
65
63
}
66
64
67
65
async sendBeacon ( ) {
You can’t perform that action at this time.
0 commit comments