forked from Ninjalama/streamyfin_mirror
chore: Apply linting rules and add git hok (#611)
Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useSettings } from "@/utils/atoms/settings";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { Platform } from "react-native";
|
||||
import { useSettings } from "@/utils/atoms/settings";
|
||||
const Haptics = !Platform.isTV ? require("expo-haptics") : null;
|
||||
|
||||
export type HapticFeedbackType =
|
||||
@@ -25,7 +25,7 @@ export const useHaptic = (feedbackType: HapticFeedbackType = "selection") => {
|
||||
? () => {}
|
||||
: () => Haptics.impactAsync(type);
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
const createNotificationFeedback = useCallback(
|
||||
(type: typeof Haptics.NotificationFeedbackType) => {
|
||||
@@ -33,7 +33,7 @@ export const useHaptic = (feedbackType: HapticFeedbackType = "selection") => {
|
||||
? () => {}
|
||||
: () => Haptics.notificationAsync(type);
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
const hapticHandlers = useMemo(
|
||||
@@ -46,14 +46,14 @@ export const useHaptic = (feedbackType: HapticFeedbackType = "selection") => {
|
||||
? () => {}
|
||||
: Haptics.selectionAsync,
|
||||
success: createNotificationFeedback(
|
||||
Haptics.NotificationFeedbackType.Success
|
||||
Haptics.NotificationFeedbackType.Success,
|
||||
),
|
||||
warning: createNotificationFeedback(
|
||||
Haptics.NotificationFeedbackType.Warning
|
||||
Haptics.NotificationFeedbackType.Warning,
|
||||
),
|
||||
error: createNotificationFeedback(Haptics.NotificationFeedbackType.Error),
|
||||
}),
|
||||
[createHapticHandler, createNotificationFeedback]
|
||||
[createHapticHandler, createNotificationFeedback],
|
||||
);
|
||||
|
||||
if (settings?.disableHapticFeedback) {
|
||||
|
||||
Reference in New Issue
Block a user