Commit ·
6a008d6
1
Parent(s): acb29be
fix: Only update currently viewed transcription
Browse filesResult heading transcription filename is replaced with whatever transcription is updated. Comparing by ID avoids replacing this content.
lib/medicode_web/live/transcriptions_live/show.ex
CHANGED
|
@@ -172,7 +172,13 @@ defmodule MedicodeWeb.TranscriptionsLive.Show do
|
|
| 172 |
end
|
| 173 |
|
| 174 |
def handle_info({:transcription_updated, transcription_id}, socket) do
|
| 175 |
-
transcription =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
transcriptions = list_transcriptions(socket.assigns.current_user)
|
| 177 |
summary_keywords = Transcriptions.list_transcription_summary_keywords(transcription.id)
|
| 178 |
finalized_codes = Transcriptions.list_transcription_finalized_codes(transcription.id)
|
|
|
|
| 172 |
end
|
| 173 |
|
| 174 |
def handle_info({:transcription_updated, transcription_id}, socket) do
|
| 175 |
+
transcription =
|
| 176 |
+
if socket.assigns.transcription.id == transcription_id do
|
| 177 |
+
get_transcription(transcription_id)
|
| 178 |
+
else
|
| 179 |
+
socket.assigns.transcription
|
| 180 |
+
end
|
| 181 |
+
|
| 182 |
transcriptions = list_transcriptions(socket.assigns.current_user)
|
| 183 |
summary_keywords = Transcriptions.list_transcription_summary_keywords(transcription.id)
|
| 184 |
finalized_codes = Transcriptions.list_transcription_finalized_codes(transcription.id)
|