We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc4cdec commit 02e85caCopy full SHA for 02e85ca
packages/frontend/src/pages/settings/profile.vue
@@ -142,13 +142,17 @@ const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.d
142
143
const reactionAcceptance = computed(defaultStore.makeGetterSetter('reactionAcceptance'));
144
145
+function assertVaildLang(lang: string | null): lang is keyof typeof langmap {
146
+ return lang != null && lang in langmap;
147
+}
148
+
149
const profile = reactive({
150
name: $i.name,
151
description: $i.description,
152
followedMessage: $i.followedMessage,
153
location: $i.location,
154
birthday: $i.birthday,
- lang: $i.lang,
155
+ lang: assertVaildLang($i.lang) ? $i.lang : null,
156
isBot: $i.isBot ?? false,
157
isCat: $i.isCat ?? false,
158
});
0 commit comments