fix: attemptStake helper produces /stakestake invalid route (#1168)

Use URL.origin instead of splitting on '#' to construct the stake URL,
preventing path duplication when the page is already on /stake.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
johba 2026-03-26 08:17:17 +00:00
parent 247a70f265
commit 473216fa2b

View file

@ -511,8 +511,8 @@ export async function attemptStake(
): Promise<void> {
console.log(`[${personaName}] Attempting to stake ${amount} KRK at tax rate ${taxRateIndex}%...`);
const baseUrl = page.url().split('#')[0];
await page.goto(`${baseUrl}stake`);
const origin = new URL(page.url()).origin;
await page.goto(`${origin}/stake`);
try {
// Wait for stake form to fully load