Skip to content

Commit

Permalink
[web] Fix nav info validator
Browse files Browse the repository at this point in the history
Summary:
[ENG-4666](https://linear.app/comm/issue/ENG-4666/validation-failure-in-website-responder)
Validator wasn't updated to match the new type

Test Plan:
Reloaded the web page in:
- login screen
- qr login screen (it was completely black, not sure if that's intended)
- after logging in in chat view
- in settings screen
There were no errors in keyserver console

Reviewers: ashoat, tomek, rohan

Reviewed By: rohan

Differential Revision: https://phab.comm.dev/D8866
  • Loading branch information
MichalGniadek committed Aug 18, 2023
1 parent 196da0d commit 5403405
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/types/nav-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import {
import { tID, tShape } from 'lib/utils/validation-utils.js';

export type NavigationTab = 'calendar' | 'chat' | 'settings';
export type LoginMethod = 'form' | 'qr-code';
const navigationTabValidator = t.enums.of(['calendar', 'chat', 'settings']);
export type LoginMethod = 'form' | 'qr-code';
const loginMethodValidator = t.enums.of(['form', 'qr-code']);

export type NavigationSettingsSection = 'account' | 'danger-zone';
const navigationSettingsSectionValidator = t.enums.of([
Expand Down Expand Up @@ -48,4 +49,5 @@ export const navInfoValidator: TInterface<NavInfo> = tShape<$Exact<NavInfo>>({
selectedUserList: t.maybe(t.list(accountUserInfoValidator)),
chatMode: t.maybe(navigationChatModeValidator),
inviteSecret: t.maybe(t.String),
loginMethod: t.maybe(loginMethodValidator),
});

0 comments on commit 5403405

Please sign in to comment.