mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
fix: bump biome and fix error (#864)
Some checks failed
🤖 Android APK Build / 🏗️ Build Android APK (push) Has been cancelled
🤖 iOS IPA Build / 🏗️ Build iOS IPA (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
Some checks failed
🤖 Android APK Build / 🏗️ Build Android APK (push) Has been cancelled
🤖 iOS IPA Build / 🏗️ Build iOS IPA (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
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 =
|
||||
@@ -14,10 +15,7 @@ export type HapticFeedbackType =
|
||||
|
||||
export const useHaptic = (feedbackType: HapticFeedbackType = "selection") => {
|
||||
const [settings] = useSettings();
|
||||
|
||||
if (Platform.isTV) {
|
||||
return () => {};
|
||||
}
|
||||
const isTv = Platform.isTV;
|
||||
|
||||
const createHapticHandler = useCallback(
|
||||
(type: typeof Haptics.ImpactFeedbackStyle) => {
|
||||
@@ -27,6 +25,7 @@ export const useHaptic = (feedbackType: HapticFeedbackType = "selection") => {
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
const createNotificationFeedback = useCallback(
|
||||
(type: typeof Haptics.NotificationFeedbackType) => {
|
||||
return Platform.OS === "web" || Platform.isTV
|
||||
@@ -56,6 +55,10 @@ export const useHaptic = (feedbackType: HapticFeedbackType = "selection") => {
|
||||
[createHapticHandler, createNotificationFeedback],
|
||||
);
|
||||
|
||||
if (isTv) {
|
||||
return () => {};
|
||||
}
|
||||
|
||||
if (settings?.disableHapticFeedback) {
|
||||
return () => {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user