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

Side by Side Diff: messageResponder.js

Issue 29533613: Issue 5593 - Return new value from prefs.toggle (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Created Sept. 1, 2017, 12:06 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 { 340 {
341 sendMessage("pref", preference, Prefs[preference]); 341 sendMessage("pref", preference, Prefs[preference]);
342 }); 342 });
343 } 343 }
344 } 344 }
345 }); 345 });
346 346
347 port.on("prefs.toggle", (message, sender) => 347 port.on("prefs.toggle", (message, sender) =>
348 { 348 {
349 if (message.key == "notifications_ignoredcategories") 349 if (message.key == "notifications_ignoredcategories")
350 NotificationStorage.toggleIgnoreCategory("*"); 350 return NotificationStorage.toggleIgnoreCategory("*");
Manish Jethani 2017/09/01 12:08:38 It's OK to return undefined here since it's a spec
Thomas Greiner 2017/09/04 10:44:19 Acknowledged.
351 else 351
352 Prefs[message.key] = !Prefs[message.key]; 352 return Prefs[message.key] = !Prefs[message.key];
Thomas Greiner 2017/09/04 10:44:19 I assume you're planning to use it in https://code
Manish Jethani 2017/09/04 11:30:02 Yes, specifically line 140 here in the new code:
353 }); 353 });
354 354
355 port.on("subscriptions.add", (message, sender) => 355 port.on("subscriptions.add", (message, sender) =>
356 { 356 {
357 let subscription = Subscription.fromURL(message.url); 357 let subscription = Subscription.fromURL(message.url);
358 if ("title" in message) 358 if ("title" in message)
359 subscription.title = message.title; 359 subscription.title = message.title;
360 if ("homepage" in message) 360 if ("homepage" in message)
361 subscription.homepage = message.homepage; 361 subscription.homepage = message.homepage;
362 362
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 if (message.url) 434 if (message.url)
435 subscriptions = [Subscription.fromURL(message.url)]; 435 subscriptions = [Subscription.fromURL(message.url)];
436 436
437 for (let subscription of subscriptions) 437 for (let subscription of subscriptions)
438 { 438 {
439 if (subscription instanceof DownloadableSubscription) 439 if (subscription instanceof DownloadableSubscription)
440 Synchronizer.execute(subscription, true); 440 Synchronizer.execute(subscription, true);
441 } 441 }
442 }); 442 });
443 })(this); 443 })(this);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld