mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 22:59:01 +02:00
feat: migrate from aiErrorAssist naming for disabling AI features to aiFeatures.enabled to avoid confusion (#31273)
feat: keep aiErrorAssistant as setting on user object until migration is run GitOrigin-RevId: df53914163566065d0b91b8d130476fbcdf1ea96
This commit is contained in:
committed by
Copybot
parent
df8190ec8c
commit
551d7b3908
@@ -168,7 +168,9 @@ async function projectListPage(req, res, next) {
|
||||
const user = await User.findById(
|
||||
userId,
|
||||
`email isAdmin emails features alphaProgram betaProgram lastPrimaryEmailCheck lastActive signUpDate ace refProviders${
|
||||
isSaas ? ' enrollment writefull completedTutorials aiErrorAssistant' : ''
|
||||
isSaas
|
||||
? ' enrollment writefull completedTutorials aiFeatures aiErrorAssistant'
|
||||
: ''
|
||||
}`
|
||||
)
|
||||
|
||||
@@ -904,7 +906,11 @@ async function _userHasAIAssist(user) {
|
||||
// It does NOT determine if the user has AI Assist enabled
|
||||
async function _canUseAIAssist(user) {
|
||||
// Check if the assistant has been manually disabled by the user
|
||||
if (user.aiErrorAssistant?.enabled === false) {
|
||||
// todo: assist clean-up: remove other case once migration finishes
|
||||
if (
|
||||
user.aiErrorAssistant?.enabled === false ||
|
||||
user.aiFeatures?.enabled === false
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user