Skip to content

Commit 63ba7ce

Browse files
committed
fix(navbar): makes i18n computed
1 parent 06d20ca commit 63ba7ce

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/components/common/navbar/NavbarSettingsDopdown.vue

+15-16
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ defineProps({
4747
},
4848
});
4949
50+
const users = computed(() => {
51+
return Object.entries(userSettings.value).filter(
52+
([key, value]) => value && key !== username.value && key !== defaultUser,
53+
);
54+
});
55+
5056
const toOption = (
5157
key: string,
5258
icon: Component | string,
@@ -63,23 +69,16 @@ const toOption = (
6369
};
6470
};
6571
66-
const baseOptions: DropdownProps['options'] = [
67-
{ type: 'divider', key: 'account-divider' },
68-
toOption('settings', IconCog),
69-
{ type: 'divider', key: 'external-links' },
70-
toOption('trakt', IconExternalLink),
71-
{ type: 'divider', key: 'session-divider' },
72-
toOption('login', IconAccountAdd),
73-
toOption('logout', IconLogOut),
74-
];
75-
76-
const users = computed(() => {
77-
return Object.entries(userSettings.value).filter(
78-
([key, value]) => value && key !== username.value && key !== defaultUser,
79-
);
80-
});
81-
8272
const options = computed<DropdownProps['options']>(() => {
73+
const baseOptions: DropdownProps['options'] = [
74+
toOption('settings', IconCog),
75+
{ type: 'divider', key: 'external-links' },
76+
toOption('trakt', IconExternalLink),
77+
{ type: 'divider', key: 'session-divider' },
78+
toOption('login', IconAccountAdd),
79+
toOption('logout', IconLogOut),
80+
];
81+
8382
if (users.value.length) {
8483
return [
8584
...users.value.map(([key, value]) =>

0 commit comments

Comments
 (0)