mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
Merge branch 'master' into feat/i18n
This commit is contained in:
@@ -4,7 +4,7 @@ import { useDownload } from "@/providers/DownloadProvider";
|
||||
import { clearLogs } from "@/utils/log";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import * as FileSystem from "expo-file-system";
|
||||
import * as Haptics from "expo-haptics";
|
||||
import { useHaptic } from "@/hooks/useHaptic";
|
||||
import { View } from "react-native";
|
||||
import * as Progress from "react-native-progress";
|
||||
import { toast } from "sonner-native";
|
||||
@@ -15,6 +15,8 @@ import { useTranslation } from "react-i18next";
|
||||
export const StorageSettings = () => {
|
||||
const { deleteAllFiles, appSizeUsage } = useDownload();
|
||||
const { t } = useTranslation();
|
||||
const successHapticFeedback = useHaptic("success");
|
||||
const errorHapticFeedback = useHaptic("error");
|
||||
|
||||
const { data: size, isLoading: appSizeLoading } = useQuery({
|
||||
queryKey: ["appSize", appSizeUsage],
|
||||
@@ -31,9 +33,9 @@ export const StorageSettings = () => {
|
||||
const onDeleteClicked = async () => {
|
||||
try {
|
||||
await deleteAllFiles();
|
||||
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||
successHapticFeedback();
|
||||
} catch (e) {
|
||||
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
|
||||
errorHapticFeedback();
|
||||
toast.error(t("home.settings.toasts.error_deleting_files"));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user