Commit 95c03dd3 authored by Alf Eaton's avatar Alf Eaton

Ignore updates to fragments of unloaded collections

parent d551f1a8
Pipeline #998 failed with stage
in 1 minute and 9 seconds
......@@ -18,6 +18,8 @@ export function collections (state = [], action) {
function addFragments () {
const collection = getCollection()
if (!collection) return
let toadd = (action.fragments || [action.fragment]).map(fragment => fragment.id)
collection.fragments = _.union(collection.fragments, toadd)
......@@ -27,6 +29,8 @@ export function collections (state = [], action) {
function removeFragments () {
const collection = getCollection()
if (!collection) return
const todel = (action.fragments || [action.fragment]).map(fragment => fragment.id)
collection.fragments = _.difference(collection.fragments, todel)
return collections
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment