Skip to content

Commit

Permalink
temp fix (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
NybyDK committed Apr 5, 2024
2 parents 1e7f262 + e7b8a3e commit c15ad13
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/classes/MPLS/CE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class CE extends Router {

updateAddress = (oldAddress: string, newAddress: string) => {
const oldValue = this.firstHop.get(oldAddress);
if (!oldValue) {
if (oldValue === undefined) {
alert(`Unable to update old first hop Address '${oldAddress}' to '${newAddress}'.`);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/classes/MPLS/FIB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class FIB {

updateAddress = (oldAddress: string, newAddress: string) => {
const oldValue = this.map.get(oldAddress);
if (!oldValue) {
if (oldValue === undefined) {
alert(`Unable to update old FIB address '${oldAddress}' to '${newAddress}'.`);
return;
}
Expand Down
6 changes: 6 additions & 0 deletions src/lib/components/RouterSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
<Dialog
bind:dialog
on:close={() => {
// TODO: Temporary fix to not crash app (ISSUE #125) - remove when fixed - it's because LSPList.svelte using getSureCERouter
if (router instanceof CE) {
for (const key of router.firstHop.keys()) {
if (key === "") router.firstHop.delete(key);
}
}
network.notify();
}}
>
Expand Down
5 changes: 3 additions & 2 deletions src/lib/components/RouterTables/Destination.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
const target = event.target.value.toUpperCase();
router.updateAddress(destination, target);
const destinationRouter = network.getCERouter(target);
if (!destinationRouter) {
Expand All @@ -30,6 +28,9 @@
const path = paths.findShortestPath(router, destinationRouter);
// Sounds counter-intuitive, but LDP sets an entry, and it cannot exist before because it returns if it already exists
router.deleteEntry(destination);
LDP(path, target);
router = router;
Expand Down

0 comments on commit c15ad13

Please sign in to comment.