Skip to content

Commit ad52c92

Browse files
Merge pull request #76 from StabilityNexus/Frontend
Fixed deployment errors
2 parents 8a4f40b + 517b1c7 commit ad52c92

File tree

9 files changed

+14
-20
lines changed

9 files changed

+14
-20
lines changed

web/src/app/[cat]/InteractionClient.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import React, { useEffect, useState, useCallback } from "react";
4-
import { Info, Coins, Settings, Unlock, Copy, ArrowUp, Target, AlertTriangle, Database, Wifi, WifiOff } from "lucide-react";
4+
import { Info, Coins, Settings, Unlock, Copy, ArrowUp, Target, AlertTriangle, Wifi, WifiOff } from "lucide-react";
55
import { Card, CardContent } from "@/components/ui/card";
66
import { getPublicClient } from "@wagmi/core";
77
import { config } from "@/utils/config";
@@ -502,7 +502,7 @@ export default function InteractionClient() {
502502
// Then sync with blockchain in background if online
503503
if (isOnline) {
504504
const lastSync = await getCache('tokenDetails_lastSync');
505-
const shouldSync = !lastSync || Date.now() - lastSync > 5 * 60 * 1000; // 5 minutes
505+
const shouldSync = !lastSync || Date.now() - (lastSync as number) > 5 * 60 * 1000; // 5 minutes
506506

507507
if (shouldSync) {
508508
console.log('Starting background sync...');

web/src/app/create/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const fields = [
9595
type: "number",
9696
placeholder: "500000",
9797
description: "The supply threshold above which further supply expansion is restricted by the maximum expansion rate.",
98-
validate: (value: string, formData: DeployContractProps) => ({
98+
validate: (value: string, _formData: DeployContractProps) => ({
9999
isValid: /^\d+$/.test(value) &&
100100
parseInt(value) > 0,
101101
errorMessage: "Threshold must be a positive number less than maximum supply"

web/src/app/my-cats/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export default function MyCATsPage() {
261261
// Check cache first unless forcing sync
262262
if (!forceSync) {
263263
const lastSync = await getCache('lastSyncTime');
264-
if (lastSync && Date.now() - lastSync < 5 * 60 * 1000) { // 5 minutes
264+
if (lastSync && Date.now() - (lastSync as number) < 5 * 60 * 1000) { // 5 minutes
265265
console.log('Recent sync found, skipping blockchain fetch');
266266
setIsSyncing(false);
267267
return;
@@ -974,7 +974,7 @@ export default function MyCATsPage() {
974974
</div>
975975
<div className="text-center">
976976
<h3 className="text-lg font-bold text-orange-800 dark:text-yellow-200">
977-
You're Offline
977+
You&apos;re Offline
978978
</h3>
979979
<p className="text-sm text-orange-600 dark:text-yellow-300">
980980
No cached CATs available. Please connect to the internet to sync your data.

web/src/app/page.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import { Button } from "@/components/ui/button"
88
import { Input } from "@/components/ui/input"
99
import { useRouter } from "next/navigation"
1010
import { ConnectButton } from "@rainbow-me/rainbowkit"
11-
import Service_1 from "../images/Service_1.png"
12-
import Service_2 from "../images/Service_2.png"
13-
import Service_3 from "../images/Service_3.png"
11+
1412
import catLight from "../images/Light_cat.png"
1513
import catDark from "../images/Dark_cat.png"
1614
import { useTheme } from "next-themes"
@@ -20,11 +18,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@
2018
import { motion, AnimatePresence } from "framer-motion"
2119
import { showTransactionToast } from "@/components/ui/transaction-toast"
2220

23-
const services = [
24-
{ image: Service_1, alt: "Semi-Transferable", description: "Semi-Transferable" },
25-
{ image: Service_2, alt: "Secure against Inflation", description: "Secure against Inflation" },
26-
{ image: Service_3, alt: "Simple to Mint", description: "Simple to Mint" },
27-
]
21+
2822

2923
const supportedChains = [
3024
{ id: "534351", name: "Scroll Sepolia" },

web/src/hooks/useCATStorage.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ interface UseCATStorageReturn {
2222
getAllUserRoles: () => Promise<UserRoleInfo[]>;
2323

2424
// Cache Management
25-
saveCache: (key: string, data: any, ttlMinutes?: number) => Promise<void>;
26-
getCache: (key: string) => Promise<any | null>;
25+
saveCache: (key: string, data: unknown, ttlMinutes?: number) => Promise<void>;
26+
getCache: (key: string) => Promise<unknown | null>;
2727
deleteCache: (key: string) => Promise<void>;
2828

2929
// Utility functions
@@ -219,7 +219,7 @@ export const useCATStorage = (): UseCATStorageReturn => {
219219
}, [address]);
220220

221221
// Cache functions
222-
const saveCache = useCallback(async (key: string, data: any, ttlMinutes: number = 30): Promise<void> => {
222+
const saveCache = useCallback(async (key: string, data: unknown, ttlMinutes: number = 30): Promise<void> => {
223223
if (!address) throw new Error('User address not available');
224224

225225
try {
@@ -230,7 +230,7 @@ export const useCATStorage = (): UseCATStorageReturn => {
230230
}
231231
}, [address]);
232232

233-
const getCache = useCallback(async (key: string): Promise<any | null> => {
233+
const getCache = useCallback(async (key: string): Promise<unknown | null> => {
234234
if (!address) return null;
235235

236236
try {

web/src/images/Service_1.png

-77.6 KB
Binary file not shown.

web/src/images/Service_2.png

-9.81 KB
Binary file not shown.

web/src/images/Service_3.png

-10.8 KB
Binary file not shown.

web/src/utils/indexedDB.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface CacheMetadata {
4747
key: string;
4848
userAddress: string;
4949
expiresAt: number;
50-
data: any;
50+
data: unknown;
5151
createdAt: number;
5252
updatedAt: number;
5353
}
@@ -413,7 +413,7 @@ class IndexedDBService {
413413
}
414414

415415
// Cache operations for performance optimization
416-
async saveCache(key: string, userAddress: string, data: any, ttlMinutes: number = 30): Promise<void> {
416+
async saveCache(key: string, userAddress: string, data: unknown, ttlMinutes: number = 30): Promise<void> {
417417
const db = await this.ensureDB();
418418
const transaction = db.transaction([this.stores.cacheMetadata], 'readwrite');
419419
const store = transaction.objectStore(this.stores.cacheMetadata);
@@ -435,7 +435,7 @@ class IndexedDBService {
435435
});
436436
}
437437

438-
async getCache(key: string, userAddress: string): Promise<any | null> {
438+
async getCache(key: string, userAddress: string): Promise<unknown | null> {
439439
const db = await this.ensureDB();
440440
const transaction = db.transaction([this.stores.cacheMetadata], 'readonly');
441441
const store = transaction.objectStore(this.stores.cacheMetadata);

0 commit comments

Comments
 (0)