Skip to content

Commit 02e85ca

Browse files
refactor
1 parent fc4cdec commit 02e85ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/frontend/src/pages/settings/profile.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,17 @@ const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.d
142142

143143
const reactionAcceptance = computed(defaultStore.makeGetterSetter('reactionAcceptance'));
144144

145+
function assertVaildLang(lang: string | null): lang is keyof typeof langmap {
146+
return lang != null && lang in langmap;
147+
}
148+
145149
const profile = reactive({
146150
name: $i.name,
147151
description: $i.description,
148152
followedMessage: $i.followedMessage,
149153
location: $i.location,
150154
birthday: $i.birthday,
151-
lang: $i.lang,
155+
lang: assertVaildLang($i.lang) ? $i.lang : null,
152156
isBot: $i.isBot ?? false,
153157
isCat: $i.isCat ?? false,
154158
});

0 commit comments

Comments
 (0)