Skip to content

Commit fe11622

Browse files
committed
Stack layer: fix a UI hang-up on reloading wrong mirror IDs
This was caused by endlessly switching mirrors to a non-existent mirror ID.
1 parent 511f4b9 commit fe11622

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ Miscellaneous:
294294
- Block image datasets like N5 or Neuroglancer now don't lead to errors anymore
295295
when their size isn't anymore a multiple of the block size.
296296

297+
- Restoring saved stack layer settings: a UI hang-up with fixed, caused by
298+
endlessly switching mirrors to a non-existent mirror ID.
299+
297300
## Maintenance updates
298301

299302
- Node distance measurements: computation of straight line distance has been

django/applications/catmaid/static/js/layers/stack-layer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,11 @@
648648
*/
649649
StackLayer.prototype.switchToMirror = function (mirrorId, force) {
650650
if (mirrorId === this.mirrorId && !force) return;
651+
// If the referenced mirror doesn't exist and is no custom mirror, then
652+
// don't attempt to switch.
653+
if (this.stack.mirrors[mirrorId] === undefined && this.getCustomMirrorIds().indexOf(mirrorId) == -1) {
654+
return;
655+
}
651656
var newStackLayer = this.constructCopy({mirrorId: mirrorId});
652657
var layerKey = this.stackViewer.getLayerKey(this);
653658
this.stackViewer.replaceStackLayer(layerKey, newStackLayer);

0 commit comments

Comments
 (0)