onboarding_steps: Depluralize OnboardingStep type name.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-03-02 12:12:56 -08:00 committed by Anders Kaseorg
parent f39675f061
commit a03a26151c
2 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -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.