cleaned code from logs and some comments
This commit is contained in:
@@ -235,7 +235,6 @@ export function useLogout() {
|
||||
}
|
||||
},
|
||||
onError: () => {
|
||||
// Always clear local state on logout
|
||||
TokenStorage.clearTokens();
|
||||
queryClient.clear();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user