mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-10-18 06:03:22 +00:00
fix invalid id error
This commit is contained in:
parent
8a8b0ed2af
commit
c4f4d4b3e1
@ -291,12 +291,8 @@ const Events = {
|
||||
let content;
|
||||
try {
|
||||
content = await Key.decrypt(event.content);
|
||||
const blockList = JSON.parse(content);
|
||||
const set = new Set<UserId>();
|
||||
for (const id of blockList) {
|
||||
set.add(ID(id));
|
||||
}
|
||||
SocialNetwork.blockedUsers = set;
|
||||
const blockList = JSON.parse(content).map(ID);
|
||||
SocialNetwork.blockedUsers = new Set(blockList);
|
||||
} catch (e) {
|
||||
console.log('failed to parse your block list', content, event);
|
||||
}
|
||||
@ -309,7 +305,7 @@ const Events = {
|
||||
const myPub = Key.getPubKey();
|
||||
if (event.pubkey === myPub) {
|
||||
try {
|
||||
const flaggedUsers = JSON.parse(event.content);
|
||||
const flaggedUsers = JSON.parse(event.content).map(ID);
|
||||
SocialNetwork.flaggedUsers = new Set(flaggedUsers);
|
||||
} catch (e) {
|
||||
console.log('failed to parse your flagged users list', event);
|
||||
|
Loading…
Reference in New Issue
Block a user