feat: add haptic feedback toggle setting

- Add haptic_enabled field to AppDTO with default value true
- Update SettingsSerializerService to deserialize haptic_enabled
- Add haptic_enabled setting in admin panel (GeneralView) with toggle
- Update admin settings store to include haptic_enabled default value
- Update SPA SettingsStore to load haptic_enabled from API
- Refactor useHapticFeedback composable to return safe wrapper object
- Replace all direct window.Telegram.WebApp.HapticFeedback usage with composable
- Update useHapticScroll to use useHapticFeedback composable
- Add getHapticFeedback helper function in CheckoutStore for store usage
- Add haptic_enabled default value to app.php configuration
- All haptic feedback methods now check settings internally
- Remove redundant if checks from components (handled in composable)
This commit is contained in:
2025-12-25 22:34:23 +03:00
parent ce2ea9dea1
commit afade85d00
23 changed files with 147 additions and 35 deletions

View File

@@ -62,6 +62,7 @@ import AppDebugMessage from "@/components/AppDebugMessage.vue";
import PrivacyPolicy from "@/components/PrivacyPolicy.vue";
import BrowserNotSupported from "@/BrowserNotSupported.vue";
import {useSwipeBack} from "@/composables/useSwipeBack.js";
import {useHapticFeedback} from "@/composables/useHapticFeedback.js";
const router = useRouter();
const route = useRoute();
@@ -69,7 +70,7 @@ const settings = useSettingsStore();
const filtersStore = useProductFiltersStore();
const keyboardStore = useKeyboardStore();
const backButton = window.Telegram.WebApp.BackButton;
const haptic = window.Telegram.WebApp.HapticFeedback;
const haptic = useHapticFeedback();
const swiperBack = useSwipeBack();
const routesToHideAppDock = [