chore(svelte/store): connection return early
This commit is contained in:
@@ -341,18 +341,18 @@ export function getInitialStore<NodeType extends Node = Node, EdgeType extends E
|
|||||||
_connection: ConnectionState = $state.raw(initialConnection);
|
_connection: ConnectionState = $state.raw(initialConnection);
|
||||||
// We derive a viewport dependent connection here
|
// We derive a viewport dependent connection here
|
||||||
connection: ConnectionState = $derived.by(() => {
|
connection: ConnectionState = $derived.by(() => {
|
||||||
if (this._connection.inProgress) {
|
if (!this._connection.inProgress) {
|
||||||
return {
|
|
||||||
...this._connection,
|
|
||||||
to: pointToRendererPoint(this._connection.to, [
|
|
||||||
this.viewport.x,
|
|
||||||
this.viewport.y,
|
|
||||||
this.viewport.zoom
|
|
||||||
])
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return this._connection;
|
return this._connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...this._connection,
|
||||||
|
to: pointToRendererPoint(this._connection.to, [
|
||||||
|
this.viewport.x,
|
||||||
|
this.viewport.y,
|
||||||
|
this.viewport.zoom
|
||||||
|
])
|
||||||
|
};
|
||||||
});
|
});
|
||||||
connectionMode: ConnectionMode = $derived(
|
connectionMode: ConnectionMode = $derived(
|
||||||
signals.props.connectionMode ?? ConnectionMode.Strict
|
signals.props.connectionMode ?? ConnectionMode.Strict
|
||||||
|
|||||||
Reference in New Issue
Block a user