cleaned code from logs and some comments

This commit is contained in:
Jelaletdin12
2025-12-19 18:14:29 +05:00
parent 0fb4e2765c
commit cdc9fa686f
45 changed files with 368 additions and 501 deletions

View File

@@ -235,7 +235,6 @@ export function useLogout() {
}
},
onError: () => {
// Always clear local state on logout
TokenStorage.clearTokens();
queryClient.clear();

View File

@@ -28,12 +28,11 @@ class TokenStorage {
static setAuthToken(token: string): void {
if (!this.isClient) return;
localStorage.setItem(AUTH_TOKEN_KEY, token);
localStorage.removeItem(GUEST_TOKEN_KEY); // Auth token replaces guest token
localStorage.removeItem(GUEST_TOKEN_KEY);
}
static setGuestToken(token: string): void {
if (!this.isClient) return;
// Only set guest token if no auth token exists
if (!this.getAuthToken()) {
localStorage.setItem(GUEST_TOKEN_KEY, token);
}

View File

@@ -12,6 +12,20 @@ export interface ProductMedia {
}
export interface Carousel {
title: string
image: string
url?: string | null
}
export interface Review {
id: number;
rating: number;
title: string;
created_at: string;
}
export type DeliveryType = "SELECTED_DELIVERY" | "PICK_UP";
export interface PaymentType {