Skip to content

Commit c052e73

Browse files
committed
self reset mechanism
1 parent b552cdf commit c052e73

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

circuitSolver/modules/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ import htm from "../js/htm.js";
77
import { init_draw2d } from "./wdk_draw2d.js";
88
import { calculateMNA, calcBilinear } from "./mna.js";
99

10+
//RESET IT ERROR OCCURS!
11+
window.onerror = function (message, file, line, col, error) {
12+
alert("The web page has crashed! Damn. If you can please describe what happened in a comment...\n\n" + error.message);
13+
window.location.href = location.protocol + '//' + location.host + location.pathname;
14+
};
15+
1016
//Decode the URL before starting and REACT stuff
1117
// Extract the query parameter
1218

circuitSolver/toDo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
- if add op amp with zero on input and LC on output, and change input to current source, it crashes
22

33

44

@@ -14,7 +14,7 @@
1414
3 - iin should not show cap size!
1515
4 - rotation state saved to the URL
1616
5 - Add url shareable button and toast
17-
17+
6- - if state is corrupted then reset!
1818
# Draw2D
1919
- [x] Add a resistor shape to toolbar
2020
- [x] Add capacitor shape to toolbar

0 commit comments

Comments
 (0)