Deleting a digest makes it sendable again
The dispatch timestamp survived the deletion, so removing a message in Slack left the digest permanently swallowed. Deleting now rewinds the window to the newest digest that still stands.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { recordAudit } from '~/data/repositories/audit'
|
||||
import {
|
||||
clearSetting,
|
||||
findLatestSentRun,
|
||||
findReportRun,
|
||||
markReportRunDeleted,
|
||||
readSettings,
|
||||
@@ -167,6 +168,14 @@ export async function performDeleteMessage(viewer: Viewer, formData: FormData):
|
||||
|
||||
await markReportRunDeleted(run.id)
|
||||
|
||||
const previous = await findLatestSentRun()
|
||||
|
||||
if (previous) {
|
||||
await writeSetting('slack.lastSentAt', previous.toAt.toISOString())
|
||||
} else {
|
||||
await clearSetting('slack.lastSentAt')
|
||||
}
|
||||
|
||||
await recordAudit({
|
||||
actorId: viewer.id,
|
||||
actorLabel: viewer.email,
|
||||
|
||||
Reference in New Issue
Block a user