- commit
- bf6db2b1346aaf8d771d6ced568d4f8260f84f4b
- parent
- 993dfca7923325446a7924ae7cda58bc33aeec47
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-05-06 04:06
use offline event instead of EventSource.onerror
Diffstat
| M | static/pad.js | 5 | +++-- |
| M | static/via.js | 1 | - |
2 files changed, 3 insertions, 3 deletions
diff --git a/static/pad.js b/static/pad.js
@@ -65,8 +65,6 @@ via.listen(room, function(msg) {
65 65 });
66 66 }
67 67 }, 1000);
68 -1 } else if (msg.type === 'error') {
69 -1 el.readOnly = true;
70 68 } else if (msg.type === 'changes') {
71 69 applyChanges(msg.data);
72 70 } else if (msg.type === 'request') {
@@ -91,3 +89,6 @@ setInterval(function() {
91 89 }, 500);
92 90
93 91 window.addEventListener('beforeunload', backup.unblock);
-1 92 window.addEventListener('offline', function() {
-1 93 el.readOnly = true;
-1 94 });
diff --git a/static/via.js b/static/via.js
@@ -17,7 +17,6 @@ export var listen = function(key, fn) {
17 17 var evtSource = new EventSource(baseUrl + 'msg/' + key);
18 18 evtSource.onmessage = msg => fn(JSON.parse(msg.data));
19 19 evtSource.onopen = () => fn({type: 'open'});
20 -1 evtSource.onerror = () => fn({type: 'error'});
21 20 };
22 21
23 22 export var store = function(key, data, beacon) {