From b854e43f6d749a849866f4b02c11507803375ef6 Mon Sep 17 00:00:00 2001 From: anekos Date: Fri, 1 Oct 2010 02:11:36 +0000 Subject: cancel したときに restart しちゃうバグ修正 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38534 d0d07461-0603-4401-acd4-de1884942a52 --- twittperator.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'twittperator.js') diff --git a/twittperator.js b/twittperator.js index 9a8bc6a..66ad5f4 100755 --- a/twittperator.js +++ b/twittperator.js @@ -28,7 +28,7 @@ let PLUGIN_INFO = Twittperator Twitter Client using ChirpStream OAuth対応Twitterクライアント - 1.8.0 + 1.8.1 2.3 2.4 teramako @@ -1224,6 +1224,7 @@ let PLUGIN_INFO = function HTTPConnection(url, options) { // {{{ const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); + this.canceled = false; this.events = {}; this.channel = @@ -1254,8 +1255,10 @@ let PLUGIN_INFO = }, cancel: function() { - if (this.channel) + if (this.channel){ + this.channeled = true; return this.channel.cancel(Cr.NS_ERROR_NOT_AVAILABLE); + } }, // 実装しないと例外になるメソッドとか @@ -1276,7 +1279,8 @@ let PLUGIN_INFO = if (Components.isSuccessCode(status)) { this.callEvent("onComplete"); } else { - this.callEvent("onError"); + if (!this.canceled) + this.callEvent("onError"); } delete this.channel; }, -- cgit v1.2.3