Commit f20f55c7 authored by Evan W. Patton's avatar Evan W. Patton

Fix logic bug in ReplMgr when no assets are present

Commit 72e0ca15 added a callback to handle loading of assets to the
Companion. However, if the Companion is connected to a project without
assets, the callback to switch from ASSET state to CONNECTED state
will never fire. This commit checks whether the asset map has 0
elements, in which case it will synchronously fire the callback so
that projects without assets will immediately transition to CONNECTED
state.

Change-Id: Iba12232966752ed9cb61af0f97aa16ebcffeed4a
parent f40f8abe
...@@ -210,6 +210,10 @@ public final class AssetManager implements ProjectChangeListener { ...@@ -210,6 +210,10 @@ public final class AssetManager implements ProjectChangeListener {
} }
} }
} }
// If no assets are in the project, perform the callback immediately.
if (assets.values().size() == 0 && assetsTransferredCallback != null) {
doCallBack(assetsTransferredCallback);
}
} }
public static void refreshAssets(String formName, JavaScriptObject callback) { public static void refreshAssets(String formName, JavaScriptObject callback) {
......
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