forked from abner/for-legacy-web
Remove remaining references to useUser(s).
Add Channel object.
This commit is contained in:
@@ -31,7 +31,6 @@ import {
|
||||
useChannels,
|
||||
useForceUpdate,
|
||||
useUserPermission,
|
||||
useUsers,
|
||||
} from "../../revoltjs/hooks";
|
||||
import { useIntermediate } from "../Intermediate";
|
||||
|
||||
|
||||
@@ -77,18 +77,6 @@ function useObject(
|
||||
: map.toArray();
|
||||
}
|
||||
|
||||
export function useUser(id?: string, context?: HookContext) {
|
||||
if (typeof id === "undefined") return;
|
||||
return useObject("users", id, context) as Readonly<Users.User> | undefined;
|
||||
}
|
||||
|
||||
export function useUsers(ids?: string[], context?: HookContext) {
|
||||
return useObject("users", ids, context) as (
|
||||
| Readonly<Users.User>
|
||||
| undefined
|
||||
)[];
|
||||
}
|
||||
|
||||
export function useChannel(id?: string, context?: HookContext) {
|
||||
if (typeof id === "undefined") return;
|
||||
return useObject("channels", id, context) as
|
||||
|
||||
Reference in New Issue
Block a user