fix reports
This commit is contained in:
parent
b112bf11c2
commit
a44b60dbc8
2 changed files with 4 additions and 3 deletions
|
|
@ -19,8 +19,9 @@ export const useReportsStore = defineStore('reports', {
|
||||||
actions: {
|
actions: {
|
||||||
openUserReportingModal({ userId, statusIds = [] }) {
|
openUserReportingModal({ userId, statusIds = [] }) {
|
||||||
const preTickedIds = new Set(statusIds)
|
const preTickedIds = new Set(statusIds)
|
||||||
// There shouldn't be a case where this is undefined
|
// There could be a case (i.e. user is only ever mentioned in someone else's post -> user popover)
|
||||||
const userAllStatusesIds = useStatusesStore().statusesPerUser.get(userId)
|
// where user has no known posts
|
||||||
|
const userAllStatusesIds = useStatusesStore().statusesPerUser.get(userId) ?? new Set()
|
||||||
// Set constructor should take care of duplicated IDs and order,
|
// Set constructor should take care of duplicated IDs and order,
|
||||||
// later duplicated IDs will be dropped in favor of earlier
|
// later duplicated IDs will be dropped in favor of earlier
|
||||||
const sortedIds = new Set([...preTickedIds, ...userAllStatusesIds])
|
const sortedIds = new Set([...preTickedIds, ...userAllStatusesIds])
|
||||||
|
|
|
||||||
|
|
@ -534,7 +534,7 @@ export const useStatusesStore = defineStore('statuses', {
|
||||||
|
|
||||||
// For when blocking a user
|
// For when blocking a user
|
||||||
wipeUserStatuses(userId) {
|
wipeUserStatuses(userId) {
|
||||||
const removed = this.statusesPerUser.get(userId)
|
const removed = this.statusesPerUser.get(userId) ?? new Set()
|
||||||
removed.forEach((statusId) => {
|
removed.forEach((statusId) => {
|
||||||
const status = this.allStatuses.get(statusId)
|
const status = this.allStatuses.get(statusId)
|
||||||
this.allStatuses.delete(statusId)
|
this.allStatuses.delete(statusId)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue