Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: options.js

Issue 29333133: Issue 3153 - Removed redundant handling of add-subscription message (Closed)
Patch Set: Created Jan. 4, 2016, 3:51 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -95,6 +95,10 @@
document.getElementById("shouldShowNotificationsContainer").hidden = true;
ext.onMessage.addListener(onMessage);
+ ext.backgroundPage.sendMessage({
+ type: "app.listen",
+ filter: ["addSubscription"]
+ });
// Load recommended subscriptions
loadRecommendations();
@@ -106,8 +110,14 @@
function onMessage(msg)
{
- if (msg.type == "add-subscription")
- startSubscriptionSelection(msg.title, msg.url);
+ if (msg.type == "app.listen")
+ {
+ if (msg.action == "addSubscription")
+ {
+ var subscription = msg.args[0];
+ startSubscriptionSelection(subscription.title, subscription.url);
+ }
+ }
else if (msg.type == "focus-section")
{
var tabs = document.getElementsByClassName("ui-tabs-panel");
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld