set the correct "marked an NSFW" when loading admin-user
This commit is contained in:
parent
58bc8f2c10
commit
3050dcbef7
2 changed files with 3 additions and 1 deletions
|
@ -632,7 +632,8 @@ export class DriveService {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async updateFile(file: MiDriveFile, values: Partial<MiDriveFile>, updater: MiUser) {
|
public async updateFile(file: MiDriveFile, values: Partial<MiDriveFile>, updater: MiUser) {
|
||||||
const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw;
|
const profile = await this.userProfilesRepository.findOneBy({ userId: file.userId });
|
||||||
|
const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw || (profile !== null && profile!.alwaysMarkNsfw);
|
||||||
|
|
||||||
if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) {
|
if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) {
|
||||||
throw new DriveService.InvalidFileNameError();
|
throw new DriveService.InvalidFileNameError();
|
||||||
|
|
|
@ -265,6 +265,7 @@ function createFetcher() {
|
||||||
moderator.value = info.value.isModerator;
|
moderator.value = info.value.isModerator;
|
||||||
silenced.value = info.value.isSilenced;
|
silenced.value = info.value.isSilenced;
|
||||||
approved.value = info.value.approved;
|
approved.value = info.value.approved;
|
||||||
|
markedAsNSFW.value = info.value.alwaysMarkNsfw;
|
||||||
suspended.value = info.value.isSuspended;
|
suspended.value = info.value.isSuspended;
|
||||||
moderationNote.value = info.value.moderationNote;
|
moderationNote.value = info.value.moderationNote;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue