Improve Android haptic, offer toggle for haptics in the app (#3482)
* improve android haptics, offer toggle for haptics * update haptics.ts * default to false * simplify to `playHaptic` * just leave them as `feedInfo` * use a hook for `playHaptic` * missed one of them
This commit is contained in:
parent
9007810cdb
commit
740cd029d7
14 changed files with 235 additions and 204 deletions
|
@ -2,7 +2,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage'
|
|||
|
||||
import {logger} from '#/logger'
|
||||
import {defaults, Schema, schema} from '#/state/persisted/schema'
|
||||
import {write, read} from '#/state/persisted/store'
|
||||
import {read, write} from '#/state/persisted/store'
|
||||
|
||||
/**
|
||||
* The shape of the serialized data from our legacy Mobx store.
|
||||
|
@ -113,6 +113,7 @@ export function transform(legacy: Partial<LegacySchema>): Schema {
|
|||
externalEmbeds: defaults.externalEmbeds,
|
||||
lastSelectedHomeFeed: defaults.lastSelectedHomeFeed,
|
||||
pdsAddressHistory: defaults.pdsAddressHistory,
|
||||
disableHaptics: defaults.disableHaptics,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {z} from 'zod'
|
||||
|
||||
import {deviceLocales} from '#/platform/detection'
|
||||
|
||||
const externalEmbedOptions = ['show', 'hide'] as const
|
||||
|
@ -58,6 +59,7 @@ export const schema = z.object({
|
|||
useInAppBrowser: z.boolean().optional(),
|
||||
lastSelectedHomeFeed: z.string().optional(),
|
||||
pdsAddressHistory: z.array(z.string()).optional(),
|
||||
disableHaptics: z.boolean().optional(),
|
||||
})
|
||||
export type Schema = z.infer<typeof schema>
|
||||
|
||||
|
@ -93,4 +95,5 @@ export const defaults: Schema = {
|
|||
useInAppBrowser: undefined,
|
||||
lastSelectedHomeFeed: undefined,
|
||||
pdsAddressHistory: [],
|
||||
disableHaptics: false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue