From 250cd0ae9ddedc3b2e78a5506286f3578a603035 Mon Sep 17 00:00:00 2001 From: MathuraMG Date: Mon, 8 Aug 2016 13:49:45 -0400 Subject: [PATCH] debounce the beep --- client/modules/IDE/components/Editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/components/Editor.js b/client/modules/IDE/components/Editor.js index c2fb565e..4469af07 100644 --- a/client/modules/IDE/components/Editor.js +++ b/client/modules/IDE/components/Editor.js @@ -35,7 +35,7 @@ class Editor extends React.Component { gutters: ['CodeMirror-lint-markers'], keyMap: 'sublime', lint: { - onUpdateLinting: (annotations) => { + onUpdateLinting: debounce(2000, (annotations) => { let isVisible = false; document.getElementById('editor-lintmessages').innerHTML = ''; annotations.forEach((x) => { @@ -47,7 +47,8 @@ class Editor extends React.Component { if (isVisible) { this.beep.play(); } - } + }) + } }); this._cm.on('change', debounce(200, () => {