diff --git a/Iceshrimp.Frontend/Components/AttachmentComponent.razor b/Iceshrimp.Frontend/Components/AttachmentComponent.razor
index 523b9654..f52b0d56 100644
--- a/Iceshrimp.Frontend/Components/AttachmentComponent.razor
+++ b/Iceshrimp.Frontend/Components/AttachmentComponent.razor
@@ -8,12 +8,13 @@
@if (Attachment.ContentType.StartsWith("image"))
{
-

+

}
-// else if (Attachment.ContentType == "audio/x-mod")
-// {
-// TODO: Module player
-// }
+ // else if (Attachment.ContentType == "audio/x-mod")
+ // {
+ // TODO: Module player
+ // }
else if (Attachment.ContentType.StartsWith("audio"))
{
@@ -49,8 +50,8 @@
@code {
- [Parameter] [EditorRequired] public required NoteAttachment Attachment { get; set; }
- [Parameter] [EditorRequired] public required EventCallback OnOpen { get; set; }
+ [Parameter] [EditorRequired] public required NoteAttachment Attachment { get; set; }
+ [Parameter] [EditorRequired] public required EventCallback OnOpen { get; set; }
private bool BlurImage { get; set; }
@@ -63,7 +64,7 @@
}
else
{
- OnOpen.InvokeAsync();
+ OnOpen.InvokeAsync(Attachment);
}
}
diff --git a/Iceshrimp.Frontend/Components/AttachmentView.razor b/Iceshrimp.Frontend/Components/AttachmentView.razor
index c1e97e72..6dad1177 100644
--- a/Iceshrimp.Frontend/Components/AttachmentView.razor
+++ b/Iceshrimp.Frontend/Components/AttachmentView.razor
@@ -81,10 +81,12 @@
await Module.InvokeVoidAsync("scrollTo", _refs[Focused]);
}
- public async Task OpenDialog()
+ public async Task OpenDialog(NoteAttachment attachment)
{
await Module.InvokeVoidAsync("openDialog", Dialog);
ScrollWidth = await Module.InvokeAsync("getScrollWidth", Scroller);
+ var index = Attachments.IndexOf(attachment);
+ await Module.InvokeVoidAsync("scrollTo", _refs[index]);
}
private async Task CloseDialog()
diff --git a/Iceshrimp.Frontend/Components/Note/NoteAttachments.razor b/Iceshrimp.Frontend/Components/Note/NoteAttachments.razor
index 337545ec..c86b7a54 100644
--- a/Iceshrimp.Frontend/Components/Note/NoteAttachments.razor
+++ b/Iceshrimp.Frontend/Components/Note/NoteAttachments.razor
@@ -11,8 +11,8 @@
[Parameter] [EditorRequired] public required IList Attachments { get; set; }
private AttachmentView View { get; set; } = null!;
- private async Task Open()
+ private async Task Open(NoteAttachment attachment)
{
- await View.OpenDialog();
+ await View.OpenDialog(attachment);
}
}
\ No newline at end of file