hotfix: try catch hasUnreadAntenna
This commit is contained in:
parent
a3f3ccf514
commit
c3456c027a
@ -256,7 +256,8 @@ export const UserRepository = db.getRepository(User).extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getHasUnreadAntenna(userId: User["id"]): Promise<boolean> {
|
async getHasUnreadAntenna(userId: User["id"]): Promise<boolean> {
|
||||||
const myAntennas = (await getAntennas()).filter((a) => a.userId === userId);
|
try {
|
||||||
|
const myAntennas = (await getAntennas()).filter((a) => a.userId === userId);
|
||||||
|
|
||||||
const unread =
|
const unread =
|
||||||
myAntennas.length > 0
|
myAntennas.length > 0
|
||||||
@ -266,7 +267,7 @@ export const UserRepository = db.getRepository(User).extend({
|
|||||||
})
|
})
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
return unread != null;
|
return unread != null; } catch(e) { return false; }
|
||||||
},
|
},
|
||||||
|
|
||||||
async getHasUnreadChannel(userId: User["id"]): Promise<boolean> {
|
async getHasUnreadChannel(userId: User["id"]): Promise<boolean> {
|
||||||
|
Loading…
Reference in New Issue
Block a user