refactor(chat): simplify paid message lock state
This commit is contained in:
@@ -5,21 +5,15 @@ import { z } from "zod";
|
||||
|
||||
import {
|
||||
booleanOrFalse,
|
||||
booleanOrTrue,
|
||||
schemaOr,
|
||||
stringOrNull,
|
||||
unknownRecordOrNull,
|
||||
} from "../nullable-defaults";
|
||||
|
||||
const CHAT_IMAGE_DEFAULTS = { type: null, url: null } as const;
|
||||
|
||||
const CHAT_LOCK_DETAIL_DEFAULTS = {
|
||||
locked: false,
|
||||
showContent: true,
|
||||
showUpgrade: false,
|
||||
reason: null,
|
||||
hint: null,
|
||||
detail: null,
|
||||
} as const;
|
||||
|
||||
export const ChatImageSchema = schemaOr(
|
||||
@@ -33,11 +27,7 @@ export const ChatImageSchema = schemaOr(
|
||||
export const ChatLockDetailSchema = schemaOr(
|
||||
z.object({
|
||||
locked: booleanOrFalse,
|
||||
showContent: booleanOrTrue,
|
||||
showUpgrade: booleanOrFalse,
|
||||
reason: stringOrNull,
|
||||
hint: stringOrNull,
|
||||
detail: unknownRecordOrNull,
|
||||
}),
|
||||
CHAT_LOCK_DETAIL_DEFAULTS,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user