mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
feat: add in-editor notification when rolling image has updated (#28529)
GitOrigin-RevId: 771773ba1914ef609b6ac84799bdda2d7ae4affa
This commit is contained in:
committed by
Copybot
parent
0b3b97e93d
commit
e05907ccc0
@@ -0,0 +1,40 @@
|
||||
import { scriptRunner } from './lib/ScriptRunner.mjs'
|
||||
import { db } from '../app/src/infrastructure/mongodb.js'
|
||||
import minimist from 'minimist'
|
||||
const argv = minimist(process.argv.slice(2))
|
||||
|
||||
async function resetTutorials() {
|
||||
const commit = argv.commit !== undefined
|
||||
|
||||
const users = await db.users
|
||||
.find(
|
||||
{
|
||||
'completedTutorials.rolling-compile-image-changed.state': 'completed',
|
||||
},
|
||||
{ readPreference: 'secondaryPreferred' }
|
||||
)
|
||||
.toArray()
|
||||
|
||||
if (!commit) {
|
||||
console.log(
|
||||
`would have removed rolling-compile-image-changed tutorial for ${users.length} users`
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
await db.users.updateMany(
|
||||
{ _id: { $in: users.map(user => user._id) } },
|
||||
{
|
||||
$unset: { 'completedTutorials.rolling-compile-image-changed': '' },
|
||||
}
|
||||
)
|
||||
console.log(`updated ${users.length} users`)
|
||||
}
|
||||
|
||||
try {
|
||||
await scriptRunner(resetTutorials)
|
||||
process.exit(0)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
}
|
||||
Reference in New Issue
Block a user