mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Update since summer sale ended
This commit is contained in:
parent
a5022443f3
commit
b67f925f4f
@ -47,21 +47,19 @@ export class PreloadState extends GameState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fetchDiscounts() {
|
async fetchDiscounts() {
|
||||||
// Summer sale specific
|
await timeoutPromise(
|
||||||
globalConfig.currentDiscount = 60;
|
fetch("https://analytics.shapez.io/v1/discounts")
|
||||||
|
.then(res => res.json())
|
||||||
// Regular
|
.then(data => {
|
||||||
// await timeoutPromise(
|
globalConfig.currentDiscount = Number(
|
||||||
// fetch("https://analytics.shapez.io/v1/discounts")
|
data["1318690"].data.price_overview.discount_percent
|
||||||
// .then(res => res.json())
|
);
|
||||||
// .then(data => {
|
logger.log("Fetched current discount:", globalConfig.currentDiscount);
|
||||||
// globalConfig.currentDiscount = Number(data["1318690"].data.price_overview.discount_percent);
|
}),
|
||||||
// logger.log("Fetched current discount:", globalConfig.currentDiscount);
|
2000
|
||||||
// }),
|
).catch(err => {
|
||||||
// 2000
|
logger.warn("Failed to fetch current discount:", err);
|
||||||
// ).catch(err => {
|
});
|
||||||
// logger.warn("Failed to fetch current discount:", err);
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendBeacon() {
|
async sendBeacon() {
|
||||||
|
Loading…
Reference in New Issue
Block a user