diff --git a/functions/src/on-create-comment-on-contract.ts b/functions/src/on-create-comment-on-contract.ts index 6bb568ff..101b085c 100644 --- a/functions/src/on-create-comment-on-contract.ts +++ b/functions/src/on-create-comment-on-contract.ts @@ -1,7 +1,13 @@ import * as functions from 'firebase-functions' import * as admin from 'firebase-admin' import { compact } from 'lodash' -import { getContract, getUser, getValues } from './utils' +import { + getContract, + getContractPath, + getUser, + getValues, + revalidateStaticProps, +} from './utils' import { ContractComment } from '../../common/comment' import { Bet } from '../../common/bet' import { Answer } from '../../common/answer' @@ -34,6 +40,8 @@ export const onCreateCommentOnContract = functions contractQuestion: contract.question, }) + await revalidateStaticProps(getContractPath(contract)) + const comment = change.data() as ContractComment const lastCommentTime = comment.createdTime