mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-22 02:55:52 -05:00
bug fix with top500 on users without twitter
This commit is contained in:
3
react-ui/src/components/user/UserPage.js
vendored
3
react-ui/src/components/user/UserPage.js
vendored
@@ -73,7 +73,7 @@ const UserPage = () => {
|
||||
if (
|
||||
userData.top500 ||
|
||||
(userLeanQuery.data.user && userData.id === userLeanQuery.data.user.id)
|
||||
)
|
||||
) {
|
||||
panes.push({
|
||||
menuItem: "X Rank",
|
||||
render: () => (
|
||||
@@ -82,6 +82,7 @@ const UserPage = () => {
|
||||
</Tab.Pane>
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
const handleTabChange = (e, { activeIndex }) => {
|
||||
setActiveIndex(activeIndex)
|
||||
|
||||
@@ -47,6 +47,11 @@ const resolvers = {
|
||||
top500: async root => {
|
||||
if (typeof root.top500 === "boolean") return root.top500
|
||||
|
||||
if (!root.twitter_name) {
|
||||
await User.findByIdAndUpdate(root._id, { top500: false })
|
||||
return false
|
||||
}
|
||||
|
||||
const player = await Player.findOne({ twitter: root.twitter_name }).catch(
|
||||
e => {
|
||||
throw (new UserInputError(),
|
||||
|
||||
Reference in New Issue
Block a user