Merge pull request #281 from LD-Reborn/feature/issue_224

Issue 224: Bug: Image of different user is visible until new image is loaded
This commit is contained in:
LD50
2025-11-06 09:26:51 +01:00
committed by GitHub
3 changed files with 11 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ public class GroupModel
string? descriptionValue = ldapData.GetValueOrDefault("description");
if (descriptionValue is null)
{
DisplayName = Cn;
Permissions = [];
}
else

View File

@@ -23,7 +23,10 @@ public class MigrationService : IHostedService
await MigrateAsync();
}
public async Task StopAsync(CancellationToken cancellationToken) { }
public async Task StopAsync(CancellationToken cancellationToken)
{
await Task.CompletedTask;
}
public async Task<MigrationModel> MigrateAsync()
{

View File

@@ -659,7 +659,7 @@
<div class="modal-body">
<div class="row g-3">
<div class="col-md-4 text-center">
<img id="detailPhoto" alt="Photo" class="img-thumbnail rounded-circle" style="max-height:150px;" />
<img id="detailPhoto" alt="Photo" class="img-thumbnail rounded-circle" style="height:150px;" />
</div>
<div class="col-md-6">
<label class="form-label" for="detailUid">@T["Username"]</label>
@@ -758,7 +758,11 @@
// Photo
const imgEl = row.querySelector('td:first-child img');
const detailPhoto = document.getElementById('detailPhoto');
detailPhoto.src = `/Home/UserPhoto?uid=${data.uid}&size=256`;
detailPhoto.src = '';
detailPhoto.src = `/Home/UserPhoto?uid=${data.uid}&size=48`;
detailPhoto.onload = () => {
detailPhoto.src = `/Home/UserPhoto?uid=${data.uid}&size=256`;
};
detailModal.show();
});
}