Skip to content

Commit

Permalink
fix(NTProvider.tsx): Swap deprecated methods to be the new versions
Browse files Browse the repository at this point in the history
  • Loading branch information
CrispyBacon1999 committed Nov 16, 2023
1 parent 665dcb8 commit d15d293
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"chromatic": "chromatic --exit-zero-on-changes"
},
"dependencies": {
"ntcore-ts-client": "^0.2.1",
"ntcore-ts-client": "^0.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down Expand Up @@ -91,4 +91,4 @@
"path": "./node_modules/cz-conventional-changelog"
}
}
}
}
4 changes: 2 additions & 2 deletions src/lib/NTProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export default function NTProvider({
// Otherwise, reconnect using the uri, or throw an error if a team number is provided
if (ntConnection === null) {
if (uri) {
setNtConnection(NetworkTables.createInstanceByURI(uri, port));
setNtConnection(NetworkTables.getInstanceByURI(uri, port));
setNtConnectionCreatedUsingTeamNumber(false);
} else if (teamNumber) {
setNtConnection(
NetworkTables.createInstanceByTeam(teamNumber, port)
NetworkTables.getInstanceByTeam(teamNumber, port)
);
setNtConnectionCreatedUsingTeamNumber(true);
oldTeamNumber.current = teamNumber;
Expand Down

0 comments on commit d15d293

Please sign in to comment.