Skip to content

Commit d004174

Browse files
committed
Don't recreate library row if it already exists
1 parent fc8e80d commit d004174

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

components/home/HomeRows.bs

+5-13
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ sub createLibraryRow()
267267

268268
sectionName = tr("My Media")
269269

270+
' We don't refresh library data, so if section already exists, exit
271+
if sectionExists(sectionName)
272+
return
273+
end if
274+
270275
row = CreateObject("roSGNode", "HomeRow")
271276
row.title = sectionName
272277
row.imageWidth = homeRowItemSizes.WIDE_POSTER[0]
@@ -277,19 +282,6 @@ sub createLibraryRow()
277282
row.appendChild(item)
278283
end for
279284

280-
' Row already exists, replace it with new content
281-
if sectionExists(sectionName)
282-
m.top.content.replaceChild(row, getSectionIndex(sectionName))
283-
284-
' Reset focus to item within the row, if it was previous highlighted
285-
if m.top.rowItemFocused[0] = getSectionIndex(sectionName)
286-
m.top.jumpToRowItem = [m.top.rowItemFocused[0], m.top.rowItemFocused[1]]
287-
end if
288-
289-
setRowItemSize()
290-
return
291-
end if
292-
293285
' Row does not exist, insert it into the home view
294286
m.top.content.insertChild(row, getOriginalSectionIndex("smalllibrarytiles"))
295287
setRowItemSize()

0 commit comments

Comments
 (0)