Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/src/app/[cat]/InteractionClient.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

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

if (shouldSync) {
console.log('Starting background sync...');
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const fields = [
type: "number",
placeholder: "500000",
description: "The supply threshold above which further supply expansion is restricted by the maximum expansion rate.",
validate: (value: string, formData: DeployContractProps) => ({
validate: (value: string, _formData: DeployContractProps) => ({
isValid: /^\d+$/.test(value) &&
parseInt(value) > 0,
errorMessage: "Threshold must be a positive number less than maximum supply"
Expand Down
4 changes: 2 additions & 2 deletions web/src/app/my-cats/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default function MyCATsPage() {
// Check cache first unless forcing sync
if (!forceSync) {
const lastSync = await getCache('lastSyncTime');
if (lastSync && Date.now() - lastSync < 5 * 60 * 1000) { // 5 minutes
if (lastSync && Date.now() - (lastSync as number) < 5 * 60 * 1000) { // 5 minutes
console.log('Recent sync found, skipping blockchain fetch');
setIsSyncing(false);
return;
Expand Down Expand Up @@ -974,7 +974,7 @@ export default function MyCATsPage() {
</div>
<div className="text-center">
<h3 className="text-lg font-bold text-orange-800 dark:text-yellow-200">
You're Offline
You&apos;re Offline
</h3>
<p className="text-sm text-orange-600 dark:text-yellow-300">
No cached CATs available. Please connect to the internet to sync your data.
Expand Down
10 changes: 2 additions & 8 deletions web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { useRouter } from "next/navigation"
import { ConnectButton } from "@rainbow-me/rainbowkit"
import Service_1 from "../images/Service_1.png"
import Service_2 from "../images/Service_2.png"
import Service_3 from "../images/Service_3.png"

import catLight from "../images/Light_cat.png"
import catDark from "../images/Dark_cat.png"
import { useTheme } from "next-themes"
Expand All @@ -20,11 +18,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@
import { motion, AnimatePresence } from "framer-motion"
import { showTransactionToast } from "@/components/ui/transaction-toast"

const services = [
{ image: Service_1, alt: "Semi-Transferable", description: "Semi-Transferable" },
{ image: Service_2, alt: "Secure against Inflation", description: "Secure against Inflation" },
{ image: Service_3, alt: "Simple to Mint", description: "Simple to Mint" },
]


const supportedChains = [
{ id: "534351", name: "Scroll Sepolia" },
Expand Down
8 changes: 4 additions & 4 deletions web/src/hooks/useCATStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ interface UseCATStorageReturn {
getAllUserRoles: () => Promise<UserRoleInfo[]>;

// Cache Management
saveCache: (key: string, data: any, ttlMinutes?: number) => Promise<void>;
getCache: (key: string) => Promise<any | null>;
saveCache: (key: string, data: unknown, ttlMinutes?: number) => Promise<void>;
getCache: (key: string) => Promise<unknown | null>;
deleteCache: (key: string) => Promise<void>;

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

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

try {
Expand All @@ -230,7 +230,7 @@ export const useCATStorage = (): UseCATStorageReturn => {
}
}, [address]);

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

try {
Expand Down
Binary file removed web/src/images/Service_1.png
Binary file not shown.
Binary file removed web/src/images/Service_2.png
Binary file not shown.
Binary file removed web/src/images/Service_3.png
Binary file not shown.
6 changes: 3 additions & 3 deletions web/src/utils/indexedDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface CacheMetadata {
key: string;
userAddress: string;
expiresAt: number;
data: any;
data: unknown;
createdAt: number;
updatedAt: number;
}
Expand Down Expand Up @@ -413,7 +413,7 @@ class IndexedDBService {
}

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

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