fix: extra insertion markers being created (#8120)

* fix: extra insertion markers being created

* chore: remove unused value
This commit is contained in:
Beka Westberg
2024-05-15 17:44:13 +00:00
committed by GitHub
parent e2eba2879d
commit dd9619dc94

View File

@@ -15,15 +15,6 @@ import * as registry from './registry.js';
import {Renderer as ZelosRenderer} from './renderers/zelos/renderer.js';
import {ConnectionType} from './connection_type.js';
/**
* An error message to throw if the block created by createMarkerBlock_ is
* missing any components.
*/
const DUPLICATE_BLOCK_ERROR =
'The insertion marker previewer tried to create a marker but the result ' +
'is missing a connection. If you are using a mutator, make sure your ' +
'domToMutation method is properly defined.';
export class InsertionMarkerPreviewer implements IConnectionPreviewer {
private readonly workspace: WorkspaceSvg;
@@ -88,16 +79,6 @@ export class InsertionMarkerPreviewer implements IConnectionPreviewer {
eventUtils.disable();
try {
this.hidePreview();
const dragged = draggedConn.getSourceBlock();
const marker = this.createInsertionMarker(dragged);
const markerConn = this.getMatchingConnection(
dragged,
marker,
draggedConn,
);
if (!markerConn) {
throw Error(DUPLICATE_BLOCK_ERROR);
}
// TODO(7898): Instead of special casing, we should change the dragger to
// track the change in distance between the dragged connection and the