From bde9896fb2877c6ea12abfe02f40945a23f05756 Mon Sep 17 00:00:00 2001 From: Timothy Farrell Date: Thu, 18 Jan 2018 13:21:50 -0600 Subject: [PATCH] Fix the annoying sections not updating on import bug. --- packages/gallery/src/interface/sectionView.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/gallery/src/interface/sectionView.js b/packages/gallery/src/interface/sectionView.js index e990f54..e08a987 100644 --- a/packages/gallery/src/interface/sectionView.js +++ b/packages/gallery/src/interface/sectionView.js @@ -63,6 +63,9 @@ export function SectionView(vm, params, key) { photos.sort((a, b) => a.originalDate.localeCompare(b.originalDate)); subscribeToRender(vm, [sections]); + vm.config({ + hooks: { willUpdate: (vm, { photos }) => photoArray.splice(0, photoArray.length, ...photos) } + }); return function render(vm, params) { const { selectedIds, selectMode, hover, hoverSelectButton } = params;