From fc62948752e3969e79c969fbec369dfd75de665c Mon Sep 17 00:00:00 2001 From: Gaubee Date: Fri, 9 Jan 2026 11:19:27 +0800 Subject: [PATCH] fix(bioforest): use relative path for genesis block URLs Use './configs/genesis' instead of '/configs/genesis' to ensure correct URL resolution when deployed to subdirectories like GitHub Pages at /KeyApp/. Fixes #194 --- src/services/bioforest-sdk/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/services/bioforest-sdk/index.ts b/src/services/bioforest-sdk/index.ts index 7db8b00d5..21f44887c 100644 --- a/src/services/bioforest-sdk/index.ts +++ b/src/services/bioforest-sdk/index.ts @@ -99,12 +99,14 @@ function getGenesisBaseUrl(): string { if (genesisBaseUrl) { return genesisBaseUrl } - // Browser: use document.baseURI to get full HTTP URL + // Browser: use relative path from document.baseURI for subdirectory deployment support + // Using './configs/genesis' instead of '/configs/genesis' ensures correct resolution + // when deployed to subdirectories (e.g., GitHub Pages at /KeyApp/) if (typeof document !== 'undefined') { - return new URL('/configs/genesis', document.baseURI).href + return new URL('./configs/genesis', document.baseURI).href } - // Fallback - return '/configs/genesis' + // Fallback for non-browser environments + return './configs/genesis' } /**