mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 17:26:17 +00:00
fix: Update version to 2.56.14 and enhance page reload logic to handle missing activities
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "microsoft-rewards-bot",
|
"name": "microsoft-rewards-bot",
|
||||||
"version": "2.56.13",
|
"version": "2.56.14",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "microsoft-rewards-bot",
|
"name": "microsoft-rewards-bot",
|
||||||
"version": "2.56.13",
|
"version": "2.56.14",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "CC-BY-NC-SA-4.0",
|
"license": "CC-BY-NC-SA-4.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "microsoft-rewards-bot",
|
"name": "microsoft-rewards-bot",
|
||||||
"version": "2.56.13",
|
"version": "2.56.14",
|
||||||
"description": "Automate Microsoft Rewards points collection",
|
"description": "Automate Microsoft Rewards points collection",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|||||||
@@ -212,8 +212,28 @@ export default class BrowserFunc {
|
|||||||
logFn: (msg) => this.bot.log(this.bot.isMobile, 'GO-HOME', msg, 'log')
|
logFn: (msg) => this.bot.log(this.bot.isMobile, 'GO-HOME', msg, 'log')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.bot.log(this.bot.isMobile, 'GO-HOME', 'Visited homepage successfully')
|
// FIXED: We're on the right URL but activities not found - force page reload to trigger DOM re-render
|
||||||
break
|
// This fixes the issue where Tyler needs to manually refresh to see activities
|
||||||
|
this.bot.log(this.bot.isMobile, 'GO-HOME', 'On correct URL but activities missing - forcing page reload to trigger DOM render', 'warn')
|
||||||
|
|
||||||
|
try {
|
||||||
|
await page.reload({ waitUntil: 'domcontentloaded', timeout: 15000 })
|
||||||
|
await waitForPageReady(page, {
|
||||||
|
timeoutMs: 10000,
|
||||||
|
logFn: (msg) => this.bot.log(this.bot.isMobile, 'GO-HOME', msg, 'log')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Try scrolling to force lazy-loaded elements to render
|
||||||
|
await page.evaluate(() => {
|
||||||
|
window.scrollTo(0, 200)
|
||||||
|
window.scrollTo(0, 0)
|
||||||
|
})
|
||||||
|
|
||||||
|
await this.bot.utils.wait(1000)
|
||||||
|
} catch (reloadError) {
|
||||||
|
const reloadMsg = reloadError instanceof Error ? reloadError.message : String(reloadError)
|
||||||
|
this.bot.log(this.bot.isMobile, 'GO-HOME', `Page reload failed: ${reloadMsg}`, 'warn')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.bot.utils.wait(2000)
|
await this.bot.utils.wait(2000)
|
||||||
|
|||||||
Reference in New Issue
Block a user