mirror of https://github.com/zulip/zulip.git
onboarding_steps: Depluralize OnboardingStep type name.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
f39675f061
commit
a03a26151c
|
@ -1,7 +1,7 @@
|
|||
import * as blueslip from "./blueslip";
|
||||
import * as channel from "./channel";
|
||||
import {current_user} from "./state_data";
|
||||
import type {OnboardingSteps} from "./state_data";
|
||||
import type {OnboardingStep} from "./state_data";
|
||||
|
||||
export const ONE_TIME_NOTICES_TO_DISPLAY = new Set<string>();
|
||||
|
||||
|
@ -21,11 +21,11 @@ export function post_onboarding_step_as_read(onboarding_step_name: string): void
|
|||
});
|
||||
}
|
||||
|
||||
export function filter_new_hotspots(onboarding_steps: OnboardingSteps[]): OnboardingSteps[] {
|
||||
export function filter_new_hotspots(onboarding_steps: OnboardingStep[]): OnboardingStep[] {
|
||||
return onboarding_steps.filter((onboarding_step) => onboarding_step.type === "hotspot");
|
||||
}
|
||||
|
||||
export function update_notice_to_display(onboarding_steps: OnboardingSteps[]): void {
|
||||
export function update_notice_to_display(onboarding_steps: OnboardingStep[]): void {
|
||||
ONE_TIME_NOTICES_TO_DISPLAY.clear();
|
||||
|
||||
for (const onboarding_step of onboarding_steps) {
|
||||
|
|
|
@ -43,9 +43,9 @@ const one_time_notice_schema = z.object({
|
|||
type: z.literal("one_time_notice"),
|
||||
});
|
||||
|
||||
const onboarding_steps_schema = z.union([one_time_notice_schema, hotspot_schema]);
|
||||
const onboarding_step_schema = z.union([one_time_notice_schema, hotspot_schema]);
|
||||
|
||||
export type OnboardingSteps = z.output<typeof onboarding_steps_schema>;
|
||||
export type OnboardingStep = z.output<typeof onboarding_step_schema>;
|
||||
|
||||
export const current_user_schema = z.object({
|
||||
avatar_source: z.string(),
|
||||
|
@ -55,7 +55,7 @@ export const current_user_schema = z.object({
|
|||
is_guest: z.boolean(),
|
||||
is_moderator: z.boolean(),
|
||||
is_owner: z.boolean(),
|
||||
onboarding_steps: z.array(onboarding_steps_schema),
|
||||
onboarding_steps: z.array(onboarding_step_schema),
|
||||
user_id: z.number(),
|
||||
});
|
||||
// Sync this with zerver.lib.events.do_events_register.
|
||||
|
|
Loading…
Reference in New Issue