Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

disconnect() API not working #21

Closed
sinabakh opened this issue Jul 13, 2016 · 3 comments
Closed

disconnect() API not working #21

sinabakh opened this issue Jul 13, 2016 · 3 comments
Assignees

Comments

@sinabakh
Copy link
Contributor

sinabakh commented Jul 13, 2016

API's disconnect() is broken.
It is BUB for sure.

More investigation is required.

@sinabakh sinabakh changed the title Disconnect API not working disconnect API not working Jul 13, 2016
@sinabakh sinabakh changed the title disconnect API not working disconnect() API not working Jul 13, 2016
@sinabakh
Copy link
Contributor Author

Ok it seems the problem is Abstraction Layer GetDotByDotOrId is returning wrong dots.

@sinabakh
Copy link
Contributor Author

sinabakh commented Jul 13, 2016

It seem the problem was something else
Here is the code of DisconnectFrom:

                public DisconnectFrom( dot: Dot ): boolean {
                    if ( this.Inputs[ dot.Id ] != undefined ) {
                        this.DisconnectInput( dot.Id );
                        return true;
                    } else if ( this.Outputs[ dot.Id ] != undefined ) {
                        this.DisconnectOutput( dot.Id );
                        return true;
                    }
                    return false;
                }

the Inputs and Outputs are arrays not dictionaries so the can be checked like that.

If we want to check the existence of a key in these arrays we should use something like this:

this.Inputs.includes(dot.Id)

@pouyakary
Copy link
Owner

That is interesting...

@sinabakh sinabakh self-assigned this Jul 13, 2016
sinabakh added a commit that referenced this issue Jul 13, 2016
sinabakh added a commit that referenced this issue Jul 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants