diff --git a/livesplit-core b/livesplit-core index 5be35be..334e37d 160000 --- a/livesplit-core +++ b/livesplit-core @@ -1 +1 @@ -Subproject commit 5be35bef56868e284c184614e778f434db4ac85a +Subproject commit 334e37d7d39046bd7c01a9f073ec449fa29ffbf2 diff --git a/src/ui/TimerView.tsx b/src/ui/TimerView.tsx index b4dac55..2d22b42 100644 --- a/src/ui/TimerView.tsx +++ b/src/ui/TimerView.tsx @@ -91,12 +91,17 @@ export class TimerView extends React.Component { > { - this.props.eventSink.updateLayoutState( - this.props.layout, - this.props.layoutState, - this.props.layoutUrlCache.imageCache, - ); - this.props.layoutUrlCache.collect(); + // The drag upload above causes the layout to be + // dropped. We need to wait for it to be replaced + // with the new layout. + if (this.props.layout.ptr !== 0) { + this.props.eventSink.updateLayoutState( + this.props.layout, + this.props.layoutState, + this.props.layoutUrlCache.imageCache, + ); + this.props.layoutUrlCache.collect(); + } return this.props.layoutState; }} layoutUrlCache={this.props.layoutUrlCache} diff --git a/test/rendering-test.js b/test/rendering-test.js index cbb136c..5854c4f 100644 --- a/test/rendering-test.js +++ b/test/rendering-test.js @@ -158,7 +158,7 @@ describe("Layout Rendering Tests", function () { testRendering("default", "default", "________8AADVVVVAAAAAAAAAAAA____________AAAAAAAAAAAA____VVVVAAAA____AAAAVVVVAAAAAADgAAD_________"); testRendering("default", "pmw3", "b_gAb9-HV8AG__AHV_AG7kAGX-AGV-AOX8APX_gOX-AP28AO_-APX-APXeAOUQAOX-AOX_gP_-AfAAAAAADgAAD_q97_____"); testRendering("splits_two_rows", "celeste", "b4AAYAAH________bwAA4AAHb-AA4AAHb-AAYAAHbwAA____bwAAYAAH_9VV____b_AAYAAH__wA____b_AAYAAPb8AAYAAP"); - testRendering("splits_with_labels", "celeste", "AAAAAABMAADnAADnAABH________WAAHfwAHfwAHTwAHVVVVAAAA0gAH_wAH_wAH3wAH_________IAP34AP34AP38APAAAA"); + testRendering("splits_with_labels", "celeste", "AAAAAAA8AAA3AAA3AAA3________WAAHfwAHfwAHTwAHVVVVAAAA0gAH_wAH_wAH3wAH_________IAP34AP34AP38APAAAA"); testRendering("title_centered_no_game_icon", "celeste", "________MzMzADAAADwAADwA________VX1VADwAAAAAAAAA____ABkAAP8DAP8DAP8DAP8D________V_1XAGAAAAAAAAAA"); testRendering("title_centered_with_game_icon", "celeste", "________AiIiQDAAYDwAYDwA________YDwAYDwAYAAAYAAAd393YBkAYL8DYP8DYP8DYP8D________d_1XYGAAAAAAAAAA"); testRendering("title_left_no_attempt_count", "celeste", "________MzMz4AAA8AAA-AAA_________VVV-AAAAAAAAAAA____GQAA_wAA_wAA_wAA_wAA________f_1XIAAAAAAAAAAA");