.
This commit is contained in:
@@ -16,7 +16,7 @@ type UsersStore = {
|
||||
|
||||
const usersFetcher = batshitCreate({
|
||||
fetcher: async (userIds: UserId[]) => {
|
||||
let users = [];
|
||||
const users = [];
|
||||
|
||||
for (const userId of userIds) {
|
||||
users.push(getUser(userId));
|
||||
@@ -32,7 +32,7 @@ export const useUsersStore = create<UsersStore>()(
|
||||
users: {},
|
||||
currentUserId: undefined,
|
||||
fetchUsersIfNotPresent: async (userIds) => {
|
||||
let userPromises: Promise<PartialUser>[] = [];
|
||||
const userPromises: Promise<PartialUser>[] = [];
|
||||
for (const userId of userIds) {
|
||||
const user = get().users[userId];
|
||||
if (!user) {
|
||||
@@ -68,6 +68,6 @@ export const useUsersStore = create<UsersStore>()(
|
||||
state.currentUserId = userId;
|
||||
}),
|
||||
|
||||
getCurrentUser: () => (!!get().currentUserId ? (get().users[get().currentUserId!] as FullUser) : undefined),
|
||||
getCurrentUser: () => (get().currentUserId ? (get().users[get().currentUserId!] as FullUser) : undefined),
|
||||
})),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user