Updated Dependencies; Added webp/avif support; adjust buzzer activation timings; always show question to host
This commit is contained in:
1 parent
e0280bafe6
commit
9d38272d1b
15 files changed
+2618
-4865
No files matched your search
@@ -162,7 +162,7 @@ exports.findGameAndAddAnsweredEntry = ( id, categoryIndex, boardEntryIndex ) =>
|
||||
categoryIndex: categoryIndex,
|
||||
boardEntryIndex: boardEntryIndex,
|
||||
}
|
||||
GameModel.findByIdAndUpdate(id, { $addToSet: { "answeredBoardEntries": dbEntry } }, { new: true } ).populate("board")
|
||||
GameModel.findByIdAndUpdate(id, { $addToSet: { "answeredBoardEntries": dbEntry } }, { returnDocument: 'after' } ).populate("board")
|
||||
.then( ( game ) => {
|
||||
if( game === null ){
|
||||
let gameNotFoundError = new Error(`No game found with id "${id}"`);
|
||||
@@ -187,7 +187,7 @@ exports.findGameAndAddAnsweredEntry = ( id, categoryIndex, boardEntryIndex ) =>
|
||||
*/
|
||||
exports.findGameAndRemoveAnsweredEntry = ( id, categoryIndex, boardEntryIndex ) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
GameModel.findByIdAndUpdate(id, { $pull: { answeredBoardEntries: { categoryIndex: categoryIndex, boardEntryIndex: boardEntryIndex } } }, { new: true } ).populate("board")
|
||||
GameModel.findByIdAndUpdate(id, { $pull: { answeredBoardEntries: { categoryIndex: categoryIndex, boardEntryIndex: boardEntryIndex } } }, { returnDocument: 'after' } ).populate("board")
|
||||
.then( ( game ) => {
|
||||
if( game === null ){
|
||||
let gameNotFoundError = new Error(`No game found with id "${id}"`);
|
||||
@@ -205,7 +205,7 @@ exports.findGameAndRemoveAnsweredEntry = ( id, categoryIndex, boardEntryIndex )
|
||||
|
||||
exports.findAcceptingGameAndSetNotAccepting = ( id ) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
GameModel.findOneAndUpdate({ _id : id, acceptAnswers: true }, { acceptAnswers: false }, { new: true })
|
||||
GameModel.findOneAndUpdate({ _id : id, acceptAnswers: true }, { acceptAnswers: false }, { returnDocument: 'after' })
|
||||
.then((game) => {
|
||||
if( game === null){
|
||||
resolve( false );
|
||||
@@ -221,7 +221,7 @@ exports.findAcceptingGameAndSetNotAccepting = ( id ) => {
|
||||
|
||||
exports.findGameAndSetAccepting = ( id, isAccepting ) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
GameModel.findByIdAndUpdate( id, { acceptAnswers: isAccepting }, { new: true }).populate("players")
|
||||
GameModel.findByIdAndUpdate( id, { acceptAnswers: isAccepting }, { returnDocument: 'after' }).populate("players")
|
||||
.then((game) => {
|
||||
if( game === null){
|
||||
let gameNotFoundError = new Error(`No game found with code "${id}"`);
|
||||
@@ -264,7 +264,7 @@ exports.setPlayerPointsAndReturnGame = ( gameId, playerId, pointsAdjusted ) => {
|
||||
points: pointsAdjusted,
|
||||
}
|
||||
},
|
||||
{ new: true }
|
||||
{ returnDocument: 'after' }
|
||||
)
|
||||
.then( ( player ) => {
|
||||
if( player === null ){
|
||||
|
||||
Reference in new issue
Block a user