Index: messageResponder.js |
=================================================================== |
--- a/messageResponder.js |
+++ b/messageResponder.js |
@@ -143,6 +143,20 @@ |
return listenerFilters; |
} |
+ function addSubscription(subscription, message) |
Thomas Greiner
2017/09/29 16:39:18
Detail: The name "message" here is quite generic.
saroyanm
2017/09/29 16:58:56
Done.
|
+ { |
+ subscription.disabled = false; |
+ if ("title" in message) |
saroyanm
2017/09/29 14:35:17
Lack of this check were causing the unexpected beh
Thomas Greiner
2017/09/29 16:39:18
The URL is used as a fallback whenever there's no
saroyanm
2017/09/29 16:58:56
I see, thanks for the info.
|
+ subscription.title = message.title; |
+ if ("homepage" in message) |
+ subscription.homepage = message.homepage; |
+ |
+ FilterStorage.addSubscription(subscription); |
+ if (subscription instanceof DownloadableSubscription && |
saroyanm
2017/09/29 14:35:17
Previously we were not checking if it's a Download
Thomas Greiner
2017/09/29 16:39:18
Acknowledged.
|
+ !subscription.lastDownload) |
+ Synchronizer.execute(subscription); |
+ } |
+ |
port.on("app.get", (message, sender) => |
{ |
if (message.what == "issues") |
@@ -331,13 +345,13 @@ |
port.on("subscriptions.add", (message, sender) => |
{ |
let subscription = Subscription.fromURL(message.url); |
- if ("title" in message) |
- subscription.title = message.title; |
- if ("homepage" in message) |
- subscription.homepage = message.homepage; |
- |
if (message.confirm) |
{ |
+ if ("title" in message) |
+ subscription.title = message.title; |
+ if ("homepage" in message) |
+ subscription.homepage = message.homepage; |
+ |
ext.showOptions(() => |
{ |
sendMessage("app", "addSubscription", subscription); |
@@ -345,12 +359,7 @@ |
} |
else |
{ |
- subscription.disabled = false; |
- FilterStorage.addSubscription(subscription); |
- |
- if (subscription instanceof DownloadableSubscription && |
- !subscription.lastDownload) |
- Synchronizer.execute(subscription); |
+ addSubscription(subscription, message); |
} |
}); |
@@ -395,12 +404,7 @@ |
} |
else |
{ |
- subscription.disabled = false; |
- subscription.title = message.title; |
- subscription.homepage = message.homepage; |
- FilterStorage.addSubscription(subscription); |
- if (!subscription.lastDownload) |
- Synchronizer.execute(subscription); |
+ addSubscription(subscription, message); |
} |
}); |