From 864f00f284a0abd8530729bd9a599a18b041fb25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 28 Jun 2012 19:21:34 +0200 Subject: [PATCH] Fixing errorhandling of getMessages Set loading to false in complete, instead of success --- file/js/be.bastelstu.WCF.Chat.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/file/js/be.bastelstu.WCF.Chat.coffee b/file/js/be.bastelstu.WCF.Chat.coffee index 13c2b99..75939bc 100644 --- a/file/js/be.bastelstu.WCF.Chat.coffee +++ b/file/js/be.bastelstu.WCF.Chat.coffee @@ -278,7 +278,6 @@ window.console ?= dataType: 'json' type: 'POST' success: $.proxy((data, textStatus, jqXHR) -> - @loading = false @handleMessages(data.messages) @handleUsers(data.users) , @) @@ -290,6 +289,9 @@ window.console ?= @freeTheFish() console.error 'We got destroyed, but could free our friend the fish before he was killed as well. Have a nice life in freedom!' alert 'herp i cannot load messages' + , @), + complete: $.proxy(() -> + @loading = false , @) beforeSend: $.proxy(() -> return false if @loading