diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 9d441d65d..ccf4772f7 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -12836,24 +12836,22 @@ g.BOARD = new Board(boardID); req = null; onload = function(e) { - var board, err, o, _i, _len, _ref; + var board, err, _i, _len, _ref; if (e.type === 'abort') { req.onloadend = null; return; } + if (req.status !== 200) { + return; + } try { - if (req.status !== 200) { - return; - } - o = JSON.parse(req.response); - _ref = o.boards; + _ref = JSON.parse(req.response).boards; for (_i = 0, _len = _ref.length; _i < _len; _i++) { board = _ref[_i]; if (board.board === boardID) { - break; + return Main.updateTitle(board); } } - return Main.updateTitle(board); } catch (_error) { err = _error; return Main.handleErrors([ diff --git a/builds/crx/script.js b/builds/crx/script.js index de7fb944f..9443cf0fd 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -12810,24 +12810,22 @@ g.BOARD = new Board(boardID); req = null; onload = function(e) { - var board, err, o, _i, _len, _ref; + var board, err, _i, _len, _ref; if (e.type === 'abort') { req.onloadend = null; return; } + if (req.status !== 200) { + return; + } try { - if (req.status !== 200) { - return; - } - o = JSON.parse(req.response); - _ref = o.boards; + _ref = JSON.parse(req.response).boards; for (_i = 0, _len = _ref.length; _i < _len; _i++) { board = _ref[_i]; if (board.board === boardID) { - break; + return Main.updateTitle(board); } } - return Main.updateTitle(board); } catch (_error) { err = _error; return Main.handleErrors([ diff --git a/src/General/Main.coffee b/src/General/Main.coffee index cb54cfaf8..49aa34864 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -409,15 +409,11 @@ Main = req.onloadend = null return + return unless req.status is 200 + try - return unless req.status is 200 - - o = JSON.parse req.response - for board in o.boards - if board.board is boardID - break - - Main.updateTitle board + for board in JSON.parse(req.response).boards + return Main.updateTitle board if board.board is boardID catch err Main.handleErrors [