Add TODOs for consequences of updating records in list views

This commit is contained in:
Claudio Ortolina
2025-01-24 11:16:04 +00:00
parent 8bf3de9b55
commit 95870aa054
3 changed files with 15 additions and 7 deletions
@@ -88,6 +88,10 @@ defmodule MusicLibraryWeb.CollectionLive.Index do
@impl true
def handle_info({MusicLibraryWeb.RecordLive.FormComponent, {:saved, record}}, socket) do
# TODO: when a record is updated, there's no guarantee that 1) it will end
# up in the same position and 2) it would still be visible given current
# filters. Instead of inserting into the stream, we should reload the
# collection with the same params.
{:noreply, stream_insert(socket, :records, record)}
end
@@ -88,6 +88,10 @@ defmodule MusicLibraryWeb.WishlistLive.Index do
@impl true
def handle_info({MusicLibraryWeb.RecordLive.FormComponent, {:saved, record}}, socket) do
# TODO: when a record is updated, there's no guarantee that 1) it will end
# up in the same position and 2) it would still be visible given current
# filters. Instead of inserting into the stream, we should reload the
# wishlist with the same params.
{:noreply, stream_insert(socket, :records, record)}
end