From 09437bdc61eaf81d6b9aae0b0e69bd8dffb759de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E5=AE=87=E8=88=AA?= Date: Tue, 18 Jul 2017 08:30:08 +0800 Subject: [PATCH] fix wrong notification on bad netstat --- ShadowsocksX-NG/Subscribe.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ShadowsocksX-NG/Subscribe.swift b/ShadowsocksX-NG/Subscribe.swift index 6f325b0..53f31eb 100644 --- a/ShadowsocksX-NG/Subscribe.swift +++ b/ShadowsocksX-NG/Subscribe.swift @@ -100,9 +100,8 @@ class Subscribe: NSObject{ callback(response.result.value!) } else{ - callback("")//give a empty callback + callback("") self.pushNotification(title: "请求失败", subtitle: "", info: "发送到\(url)的请求失败,请检查您的网络") - // alse push a notification indicate that the profile may not available } } } @@ -125,6 +124,7 @@ class Subscribe: NSObject{ return getMaxFromRes(resString: cache) } sendRequest(url: self.subscribeFeed, options: "", callback: { resString in + if resString == "" {return} getMaxFromRes(resString: resString) self.cache = resString }) @@ -164,6 +164,7 @@ class Subscribe: NSObject{ // return updateServerHandler(resString: cache) // } sendRequest(url: self.subscribeFeed, options: "", callback: { resString in + if resString == "" {return} updateServerHandler(resString: resString) self.cache = resString })