register update
This commit is contained in:
@@ -34,7 +34,6 @@ export async function registerForPushNotificationsAsync() {
|
||||
}
|
||||
|
||||
if (finalStatus !== 'granted') {
|
||||
console.log('Notification uchun ruxsat berilmadi!');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,10 +42,6 @@ export async function registerForPushNotificationsAsync() {
|
||||
projectId: '67d5a024-4eb7-44ec-8b18-6c9187bd1862',
|
||||
})
|
||||
).data;
|
||||
|
||||
console.log('Push Token:', token);
|
||||
} else {
|
||||
console.log('Push notification faqat real qurilmalarda ishlaydi!');
|
||||
}
|
||||
|
||||
return token;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useTheme } from '@/components/ThemeContext';
|
||||
import { products_api } from '@/screens/home/lib/api';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { AxiosError } from 'axios';
|
||||
import { ChevronLeft, ChevronRight } from 'lucide-react-native';
|
||||
import React, { Dispatch, SetStateAction, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
FlatList,
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import { Toast } from 'toastify-react-native';
|
||||
|
||||
interface Category {
|
||||
id: number;
|
||||
@@ -44,6 +45,7 @@ export default function CategorySelect({ selectedCategories, setSelectedCategori
|
||||
const [currentCategories, setCurrentCategories] = useState<Category[]>([]);
|
||||
const [currentParentId, setCurrentParentId] = useState<number | null>(null);
|
||||
const [history, setHistory] = useState<HistoryItem[]>([]);
|
||||
const { t } = useTranslation()
|
||||
|
||||
// Root categories
|
||||
const { isLoading: rootLoading, error: rootError } = useQuery<CategoryResponse>({
|
||||
@@ -66,8 +68,8 @@ export default function CategorySelect({ selectedCategories, setSelectedCategori
|
||||
setCurrentCategories(childCategories);
|
||||
setCurrentParentId(id);
|
||||
},
|
||||
onError: (err: AxiosError) => {
|
||||
console.error('Child category loading error:', err);
|
||||
onError: () => {
|
||||
Toast.error(t("Xatolik yuz berdi"))
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import BottomSheet, {
|
||||
BottomSheetScrollView,
|
||||
} from '@gorhom/bottom-sheet';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { AxiosError } from 'axios';
|
||||
import { Image } from 'expo-image';
|
||||
import { CheckIcon, ChevronRight, XIcon } from 'lucide-react-native';
|
||||
import React, { Dispatch, SetStateAction, useCallback, useMemo, useRef, useState } from 'react';
|
||||
@@ -75,7 +74,6 @@ export default function FilterUI({ back, onApply, setStep, setFiltered }: Filter
|
||||
setStep('items');
|
||||
setFiltered(data.data.data.results);
|
||||
},
|
||||
onError: (error: AxiosError) => console.log(error),
|
||||
});
|
||||
|
||||
const handleApply = () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { products_api } from '@/screens/home/lib/api';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { AxiosError } from 'axios';
|
||||
import { ChevronLeft, ChevronRight } from 'lucide-react-native';
|
||||
import React, { Dispatch, SetStateAction, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
FlatList,
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import { Toast } from 'toastify-react-native';
|
||||
import { useTheme } from '../ThemeContext';
|
||||
|
||||
interface Category {
|
||||
@@ -39,6 +40,7 @@ export default function CategorySelection({ selectedCategories, setSelectedCateg
|
||||
const [history, setHistory] = useState<{ parentId: number | null; categories: Category[] }[]>([]);
|
||||
const [currentParentId, setCurrentParentId] = useState<number | null>(null);
|
||||
const { isDark } = useTheme();
|
||||
const { t } = useTranslation()
|
||||
|
||||
const theme = {
|
||||
cardBg: isDark ? '#1e293b' : '#f8fafc',
|
||||
@@ -75,8 +77,8 @@ export default function CategorySelection({ selectedCategories, setSelectedCateg
|
||||
setCurrentCategories(childCategories);
|
||||
setCurrentParentId(id);
|
||||
},
|
||||
onError: (err: AxiosError) => {
|
||||
console.error('Child yuklashda xato:', err);
|
||||
onError: () => {
|
||||
Toast.error(t("Xatolik yuz berdi"))
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -18,9 +18,7 @@ export function RefreshProvider({ children }: { children: React.ReactNode }) {
|
||||
setRefreshing(true);
|
||||
try {
|
||||
await queryClient.refetchQueries();
|
||||
} catch (err) {
|
||||
console.error('Global refresh error:', err);
|
||||
} finally {
|
||||
} catch (err) { } finally {
|
||||
setRefreshing(false);
|
||||
}
|
||||
}, [queryClient, refreshing]);
|
||||
|
||||
@@ -13,7 +13,5 @@ export const script = (mode: string) => {
|
||||
documentElement.classList.remove(theme === 'light' ? 'dark' : 'light');
|
||||
documentElement.classList.add(theme);
|
||||
documentElement.style.colorScheme = theme;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
} catch (e) { }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user