diff options
author | Hailey <me@haileyok.com> | 2024-04-11 15:20:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-11 15:20:26 -0700 |
commit | 740cd029d7162a936d16b427201eb8972e365b94 (patch) | |
tree | ff4cf80cc8cd88bd958abd68c3cb3aa46328240e /src/state/persisted | |
parent | 9007810cdb5ffc8fbdf8e2a2af6c073b76b318f3 (diff) | |
download | voidsky-740cd029d7162a936d16b427201eb8972e365b94.tar.zst |
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
Diffstat (limited to 'src/state/persisted')
-rw-r--r-- | src/state/persisted/legacy.ts | 3 | ||||
-rw-r--r-- | src/state/persisted/schema.ts | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/state/persisted/legacy.ts b/src/state/persisted/legacy.ts index fd94a96a2..ca7967cd2 100644 --- a/src/state/persisted/legacy.ts +++ b/src/state/persisted/legacy.ts @@ -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, } } diff --git a/src/state/persisted/schema.ts b/src/state/persisted/schema.ts index 0aefaa474..67e082a95 100644 --- a/src/state/persisted/schema.ts +++ b/src/state/persisted/schema.ts @@ -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, } |