From 99afc4bef3e6d7c92ee3076fb37f2884e9ccfe03 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Tue, 19 Jun 2018 12:04:04 -0400 Subject: [PATCH] Make backpack web source adding idempotent --- src/containers/backpack.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/containers/backpack.jsx b/src/containers/backpack.jsx index a489279b2..b6068cb5d 100644 --- a/src/containers/backpack.jsx +++ b/src/containers/backpack.jsx @@ -23,11 +23,13 @@ class Backpack extends React.Component { }; // If a host is given, add it as a web source to the storage module - if (props.host) { + // TODO remove the hacky flag that prevents double adding + if (props.host && !storage._hasAddedBackpackSource) { storage.addWebSource( [storage.AssetType.ImageVector, storage.AssetType.ImageBitmap, storage.AssetType.Sound], asset => `${props.host}/${asset.assetId}.${asset.dataFormat}` ); + storage._hasAddedBackpackSource = true; } } handleToggle () {