add store review prompt based on number of sessions

This commit is contained in:
Ansh Nanda
2023-11-16 15:02:22 -08:00
parent 6aa865ea41
commit e522f69b1e
5 changed files with 108 additions and 0 deletions
+6
View File
@@ -106,6 +106,12 @@ export function transform(legacy: Partial<LegacySchema>): Schema {
onboarding: {
step: legacy.onboarding?.step || defaults.onboarding.step,
},
storeReview: {
completed: false,
lastPromptedAt: undefined,
numSessions: 0,
numFollowed: 0,
},
}
}
+12
View File
@@ -39,6 +39,12 @@ export const schema = z.object({
onboarding: z.object({
step: z.string(),
}),
storeReview: z.object({
lastPromptedAt: z.date().optional(),
completed: z.boolean(),
numSessions: z.number(),
numFollowed: z.number(),
}),
})
export type Schema = z.infer<typeof schema>
@@ -67,4 +73,10 @@ export const defaults: Schema = {
onboarding: {
step: 'Home',
},
storeReview: {
lastPromptedAt: undefined,
completed: false,
numSessions: 0,
numFollowed: 0,
},
}