Fix duplicate member entries.

This commit is contained in:
Paul 2021-07-30 23:43:26 +01:00
parent 4c9554c5e9
commit bdd93e8840
5 changed files with 8 additions and 6 deletions

View file

@ -97,7 +97,7 @@
"react-router-dom": "^5.2.0",
"react-scroll": "^1.8.2",
"redux": "^4.1.0",
"revolt.js": "5.0.0-alpha.5",
"revolt.js": "5.0.0-alpha.7",
"rimraf": "^3.0.2",
"sass": "^1.35.1",
"shade-blend-color": "^1.0.0",

View file

@ -145,6 +145,7 @@ export function useAutoComplete(
case "TextChannel":
const server = channel.server_id;
users = [...client.members.keys()]
.map((x) => JSON.parse(x))
.filter((x) => x.server === server)
.map((x) => client.users.get(x.user))
.filter(

View file

@ -172,6 +172,7 @@ export const ServerMemberSidebar = observer(
}, [status]);
let users = [...client.members.keys()]
.map((x) => JSON.parse(x))
.filter((x) => x.server === channel.server_id)
.map((y) => client.users.get(y.user)!)
.filter((z) => typeof z !== "undefined");

View file

@ -293,7 +293,7 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
try {
client.members
.get({
.getKey({
server: props.target._id,
user: props.user._id,
})

View file

@ -3570,10 +3570,10 @@ revolt-api@0.5.1-alpha.10-patch.0:
resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.1-alpha.10-patch.0.tgz#97d31bec7dfa4573567097443acb059c4feaac20"
integrity sha512-UyM890HkGlYNQOxpHuEpUsJHLt8Ujnjg9/zPEDGpbvS4iy0jmHX23Hh8tOCfb/ewxbNrtT3G1HpSWKOneW/vYg==
revolt.js@5.0.0-alpha.5:
version "5.0.0-alpha.5"
resolved "https://registry.yarnpkg.com/revolt.js/-/revolt.js-5.0.0-alpha.5.tgz#96008a1bf91e80b17ff877b59ca3f4fd9151055d"
integrity sha512-HOMblFOR25pE1NMGK4EYgvWqfWADyiGTZlvFpio8CEca3lAmr2jWjJAly5BWMy1SwFcfHmtHIy6Lm5Pkgjop9Q==
revolt.js@5.0.0-alpha.7:
version "5.0.0-alpha.7"
resolved "https://registry.yarnpkg.com/revolt.js/-/revolt.js-5.0.0-alpha.7.tgz#b84b424a20359b305a3d87627e82f6c7e7835c5b"
integrity sha512-BH1px02kke5hDRvpnwEu7y09oYQxJm4ZKQdy8JRqBJ73LOQgYyEnmv0Jcumb9fwcGaBHZQKPErhlYDJtb37img==
dependencies:
axios "^0.19.2"
eventemitter3 "^4.0.7"