From 8f581725651c4b2c213d75fc028e306bbf239d3e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Aug 2021 10:15:55 +0200 Subject: Allow accounts to skip account setup modal --- server/models/user/user.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'server/models/user/user.ts') diff --git a/server/models/user/user.ts b/server/models/user/user.ts index 069d7266e..ddce455a1 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts @@ -39,8 +39,6 @@ import { UserAdminFlag } from '../../../shared/models/users/user-flag.model' import { NSFWPolicyType } from '../../../shared/models/videos/nsfw-policy.type' import { isThemeNameValid } from '../../helpers/custom-validators/plugins' import { - isNoInstanceConfigWarningModal, - isNoWelcomeModal, isUserAdminFlagsValid, isUserAutoPlayNextVideoPlaylistValid, isUserAutoPlayNextVideoValid, @@ -48,6 +46,7 @@ import { isUserBlockedReasonValid, isUserBlockedValid, isUserEmailVerifiedValid, + isUserNoModal, isUserNSFWPolicyValid, isUserPasswordValid, isUserRoleValid, @@ -349,7 +348,7 @@ export class UserModel extends Model>> { @Default(false) @Is( 'UserNoInstanceConfigWarningModal', - value => throwIfNotValid(value, isNoInstanceConfigWarningModal, 'no instance config warning modal') + value => throwIfNotValid(value, isUserNoModal, 'no instance config warning modal') ) @Column noInstanceConfigWarningModal: boolean @@ -357,12 +356,21 @@ export class UserModel extends Model>> { @AllowNull(false) @Default(false) @Is( - 'UserNoInstanceConfigWarningModal', - value => throwIfNotValid(value, isNoWelcomeModal, 'no welcome modal') + 'UserNoWelcomeModal', + value => throwIfNotValid(value, isUserNoModal, 'no welcome modal') ) @Column noWelcomeModal: boolean + @AllowNull(false) + @Default(false) + @Is( + 'UserNoAccountSetupWarningModal', + value => throwIfNotValid(value, isUserNoModal, 'no account setup warning modal') + ) + @Column + noAccountSetupWarningModal: boolean + @AllowNull(true) @Default(null) @Column @@ -920,6 +928,7 @@ export class UserModel extends Model>> { noInstanceConfigWarningModal: this.noInstanceConfigWarningModal, noWelcomeModal: this.noWelcomeModal, + noAccountSetupWarningModal: this.noAccountSetupWarningModal, blocked: this.blocked, blockedReason: this.blockedReason, -- cgit v1.2.3