diff --git a/cypress/support/hooks.ts b/cypress/support/hooks.ts index 92fa2148bb..a36afdcc6f 100644 --- a/cypress/support/hooks.ts +++ b/cypress/support/hooks.ts @@ -9,6 +9,8 @@ import { Firestore } from './db/firebase' */ before(() => { + indexedDB.deleteDatabase('OneArmyCache') + cy.clearLocalStorage() cy.wrap('Initialising Database').then({ timeout: 60000 }, doc => { // large initial timeout in case server slow to respond return new Cypress.Promise(async resolve => { diff --git a/functions/src/Integrations/firebase-discord.ts b/functions/src/Integrations/firebase-discord.ts index eee86fbf34..54ccb370d5 100644 --- a/functions/src/Integrations/firebase-discord.ts +++ b/functions/src/Integrations/firebase-discord.ts @@ -12,7 +12,8 @@ export const notifyPinAccepted = functions.firestore .onWrite(async (change, context) => { const info = change.after.exists ? change.after.data() : null const prevInfo = change.before.exists ? change.before.data() : null - const beenAccepted = (prevInfo !== null) ? prevInfo.hasBeenAccepted : null; + const beenAccepted = + prevInfo !== null ? prevInfo.moderation === 'accepted' : null if (info === null || info.moderation !== 'accepted' || beenAccepted) { return } diff --git a/src/models/common.models.tsx b/src/models/common.models.tsx index d0b6b95886..87431a4444 100644 --- a/src/models/common.models.tsx +++ b/src/models/common.models.tsx @@ -27,7 +27,6 @@ export type IModerationStatus = export interface IModerable { moderation: IModerationStatus - hasBeenAccepted?: boolean _createdBy?: string _id?: string } diff --git a/src/stores/Maps/maps.store.ts b/src/stores/Maps/maps.store.ts index dde5e5aafe..84c7fdc1b0 100644 --- a/src/stores/Maps/maps.store.ts +++ b/src/stores/Maps/maps.store.ts @@ -163,9 +163,6 @@ export class MapsStore extends ModuleStore { if (!hasAdminRights(this.activeUser)) { return false } - if (pin.moderation === 'accepted') { - pin.hasBeenAccepted = true - } this.setPin(pin) } public needsModeration(pin: IMapPin) {