```
chore: enhance .gitignore and remove obsolete documentation files - Reorganize .gitignore with categorized sections for better maintainability - Add comprehensive ignore patterns for Python, Node.js, databases, logs, and build artifacts - Add project-specific ignore rules for coordinator, explorer, and deployment files - Remove outdated documentation: BITCOIN-WALLET-SETUP.md, LOCAL_ASSETS_SUMMARY.md, README-CONTAINER-DEPLOYMENT.md, README-DOMAIN-DEPLOYMENT.md ```
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { CONFIG, type DataMode } from "../config";
|
||||
import { config, type DataMode } from "../config";
|
||||
import { notifyError } from "../components/notifications";
|
||||
import type {
|
||||
BlockListResponse,
|
||||
@@ -29,9 +29,20 @@ function loadStoredMode(): DataMode | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
const initialMode = loadStoredMode() ?? CONFIG.dataMode;
|
||||
// Force live mode - ignore stale localStorage
|
||||
const storedMode = loadStoredMode();
|
||||
const initialMode = storedMode === "mock" ? "live" : (storedMode ?? config.dataMode);
|
||||
let currentMode: DataMode = initialMode;
|
||||
|
||||
// Clear any cached mock mode preference
|
||||
if (storedMode === "mock" && typeof window !== "undefined") {
|
||||
try {
|
||||
window.localStorage.setItem(STORAGE_KEY, "live");
|
||||
} catch (error) {
|
||||
console.warn("[Explorer] Failed to update cached mode", error);
|
||||
}
|
||||
}
|
||||
|
||||
function syncDocumentMode(mode: DataMode): void {
|
||||
if (typeof document !== "undefined") {
|
||||
document.documentElement.dataset.mode = mode;
|
||||
@@ -63,7 +74,7 @@ export async function fetchBlocks(): Promise<BlockSummary[]> {
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${CONFIG.apiBaseUrl}/explorer/blocks`);
|
||||
const response = await fetch(`${config.apiBaseUrl}/explorer/blocks`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch blocks: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
@@ -87,7 +98,7 @@ export async function fetchTransactions(): Promise<TransactionSummary[]> {
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${CONFIG.apiBaseUrl}/explorer/transactions`);
|
||||
const response = await fetch(`${config.apiBaseUrl}/explorer/transactions`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch transactions: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
@@ -111,7 +122,7 @@ export async function fetchAddresses(): Promise<AddressSummary[]> {
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${CONFIG.apiBaseUrl}/explorer/addresses`);
|
||||
const response = await fetch(`${config.apiBaseUrl}/explorer/addresses`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch addresses: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
@@ -135,7 +146,7 @@ export async function fetchReceipts(): Promise<ReceiptSummary[]> {
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${CONFIG.apiBaseUrl}/explorer/receipts`);
|
||||
const response = await fetch(`${config.apiBaseUrl}/explorer/receipts`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch receipts: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
@@ -153,7 +164,7 @@ export async function fetchReceipts(): Promise<ReceiptSummary[]> {
|
||||
}
|
||||
|
||||
async function fetchMock<T>(resource: string): Promise<T> {
|
||||
const url = `${CONFIG.mockBasePath}/${resource}.json`;
|
||||
const url = `${config.mockBasePath}/${resource}.json`;
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
|
||||
@@ -41,13 +41,26 @@ export interface AddressListResponse {
|
||||
|
||||
export interface ReceiptSummary {
|
||||
receiptId: string;
|
||||
jobId?: string;
|
||||
miner: string;
|
||||
coordinator: string;
|
||||
issuedAt: string;
|
||||
status: string;
|
||||
payload?: {
|
||||
job_id?: string;
|
||||
provider?: string;
|
||||
client?: string;
|
||||
units?: number;
|
||||
unit_type?: string;
|
||||
unit_price?: number;
|
||||
price?: number;
|
||||
minerSignature?: string;
|
||||
coordinatorSignature?: string;
|
||||
signature?: {
|
||||
alg?: string;
|
||||
key_id?: string;
|
||||
sig?: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user