perf(frontend): cache user lists
This commit is contained in:
@@ -8,7 +8,7 @@ import { userActions } from '@/store';
|
||||
import { $i, iAmModerator } from '@/account';
|
||||
import { mainRouter } from '@/router';
|
||||
import { Router } from '@/nirax';
|
||||
import { rolesCache } from '@/cache';
|
||||
import { rolesCache, userListsCache } from '@/cache';
|
||||
|
||||
export function getUserMenu(user: misskey.entities.UserDetailed, router: Router = mainRouter) {
|
||||
const meId = $i ? $i.id : null;
|
||||
@@ -127,7 +127,7 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
|
||||
icon: 'ti ti-list',
|
||||
text: i18n.ts.addToList,
|
||||
children: async () => {
|
||||
const lists = await os.api('users/lists/list');
|
||||
const lists = await userListsCache.fetch(() => os.api('users/lists/list'));
|
||||
|
||||
return lists.map(list => ({
|
||||
text: list.name,
|
||||
|
Reference in New Issue
Block a user