mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-04-22 03:07:55 +00:00
fix: change debug console.log to console.warn for lint
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pezkuwi-telegram-miniapp",
|
||||
"version": "1.0.128",
|
||||
"version": "1.0.129",
|
||||
"type": "module",
|
||||
"description": "Pezkuwichain Telegram Mini App - Forum, Announcements, Rewards",
|
||||
"author": "Pezkuwichain Team",
|
||||
|
||||
@@ -82,14 +82,14 @@ export function LPStakingModal({ isOpen, onClose }: LPStakingModalProps) {
|
||||
poolId,
|
||||
address
|
||||
);
|
||||
console.log('[LP Staking] Pool', poolId, 'stakeInfo:', stakeInfo.toString());
|
||||
console.warn('[LP Staking] Pool', poolId, 'stakeInfo:', stakeInfo.toString());
|
||||
if (stakeInfo && !stakeInfo.isEmpty && !stakeInfo.isNone) {
|
||||
const stakeData = stakeInfo.isSome
|
||||
? stakeInfo.unwrap().toJSON()
|
||||
: stakeInfo.toJSON();
|
||||
userStaked = stakeData.amount?.toString() || '0';
|
||||
pendingRewards = stakeData.rewards?.toString() || '0';
|
||||
console.log('[LP Staking] User staked in pool', poolId, ':', userStaked);
|
||||
console.warn('[LP Staking] User staked in pool', poolId, ':', userStaked);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error fetching stake info:', err);
|
||||
|
||||
+9
-9
@@ -73,7 +73,7 @@ export async function fetchRelayStakingDetails(
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (!(relayApi?.query as any)?.staking) {
|
||||
console.log('[Staking] staking pallet not found');
|
||||
console.warn('[Staking] staking pallet not found');
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ export async function fetchRelayStakingDetails(
|
||||
// Ledger might be wrapped in Option
|
||||
const unwrapped = ledger.isSome ? ledger.unwrap() : ledger;
|
||||
const ledgerJson = unwrapped.toJSON() as { active?: string | number; stash?: string };
|
||||
console.log('[Staking] Ledger found for', address, ':', ledgerJson);
|
||||
console.warn('[Staking] Ledger found for', address, ':', ledgerJson);
|
||||
active = BigInt(ledgerJson?.active || 0);
|
||||
if (ledgerJson?.stash) {
|
||||
stashAddress = ledgerJson.stash;
|
||||
@@ -100,17 +100,17 @@ export async function fetchRelayStakingDetails(
|
||||
const bonded = await (relayApi.query.staking as any).bonded?.(address);
|
||||
if (bonded && !bonded.isEmpty && !bonded.isNone) {
|
||||
const controller = bonded.toString();
|
||||
console.log('[Staking] Address', address, 'is stash, controller:', controller);
|
||||
console.warn('[Staking] Address', address, 'is stash, controller:', controller);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
ledger = await (relayApi.query.staking as any).ledger?.(controller);
|
||||
if (ledger && !ledger.isEmpty && !ledger.isNone) {
|
||||
const unwrapped = ledger.isSome ? ledger.unwrap() : ledger;
|
||||
const ledgerJson = unwrapped.toJSON() as { active?: string | number };
|
||||
console.log('[Staking] Ledger from controller:', ledgerJson);
|
||||
console.warn('[Staking] Ledger from controller:', ledgerJson);
|
||||
active = BigInt(ledgerJson?.active || 0);
|
||||
}
|
||||
} else {
|
||||
console.log('[Staking] No ledger or bonded found for', address);
|
||||
console.warn('[Staking] No ledger or bonded found for', address);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ export async function fetchUserTikis(peopleApi: ApiPromise, address: string): Pr
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (!(peopleApi?.query as any)?.tiki) {
|
||||
console.log('[Tiki] tiki pallet not found');
|
||||
console.warn('[Tiki] tiki pallet not found');
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -293,14 +293,14 @@ export async function fetchUserTikis(peopleApi: ApiPromise, address: string): Pr
|
||||
}
|
||||
|
||||
if (!result || result.isEmpty) {
|
||||
console.log('[Tiki] No tikis found for', address);
|
||||
console.warn('[Tiki] No tikis found for', address);
|
||||
return [];
|
||||
}
|
||||
|
||||
// Result is Vec<TikiRole> which are enum variants as strings
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const tikis = result.toJSON() as any[];
|
||||
console.log('[Tiki] Raw tikis for', address, ':', tikis);
|
||||
console.warn('[Tiki] Raw tikis for', address, ':', tikis);
|
||||
|
||||
return tikis.map((tiki, index) => {
|
||||
// Tiki can be a string (enum variant name) or object
|
||||
@@ -340,7 +340,7 @@ export function calculateTikiScore(tikis: TikiInfo[]): number {
|
||||
maxScore = Math.max(maxScore, tikiScore);
|
||||
}
|
||||
|
||||
console.log('[Tiki] Calculated score:', maxScore, 'from tikis:', tikis);
|
||||
console.warn('[Tiki] Calculated score:', maxScore, 'from tikis:', tikis);
|
||||
return Math.min(maxScore, 50); // Capped at 50
|
||||
}
|
||||
|
||||
|
||||
@@ -101,8 +101,8 @@ export function RewardsSection() {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('[Scores] Fetching scores for', address);
|
||||
console.log('[Scores] API connected:', !!api, 'People API:', !!peopleApi);
|
||||
console.warn('[Scores] Fetching scores for', address);
|
||||
console.warn('[Scores] API connected:', !!api, 'People API:', !!peopleApi);
|
||||
|
||||
setScoresLoading(true);
|
||||
try {
|
||||
@@ -110,7 +110,7 @@ export function RewardsSection() {
|
||||
getAllScoresWithFallback(peopleApi, api, address),
|
||||
api ? getFrontendStakingScore(api, address) : Promise.resolve(null),
|
||||
]);
|
||||
console.log('[Scores] Results:', { scores, staking });
|
||||
console.warn('[Scores] Results:', { scores, staking });
|
||||
setUserScores(scores);
|
||||
setStakingDetails(staking);
|
||||
} catch (err) {
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.0.128",
|
||||
"buildTime": "2026-02-06T23:24:16.209Z",
|
||||
"buildNumber": 1770420256209
|
||||
"version": "1.0.129",
|
||||
"buildTime": "2026-02-06T23:26:35.940Z",
|
||||
"buildNumber": 1770420395941
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user