mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
hotspots: Fix real-time sync for dismissing hotspots.
This closes all the hotspots which aren't included in the event.hotspots. This means we treat all the hotspots in event.hotspots as the hotspot which need to be shown. Fixes: #8690.
This commit is contained in:
committed by
Tim Abbott
parent
120ebc8f13
commit
b34b8cdb97
@@ -216,7 +216,15 @@ exports.close_hotspot_icon = function (elem) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function close_read_hotspots(new_hotspots) {
|
||||||
|
var unwanted_hotspots = _.difference(_.keys(HOTSPOT_LOCATIONS), _.pluck(new_hotspots, 'name'));
|
||||||
|
_.each(unwanted_hotspots, function (hotspot_name) {
|
||||||
|
exports.close_hotspot_icon($('#hotspot_' + hotspot_name + '_icon'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
exports.load_new = function (new_hotspots) {
|
exports.load_new = function (new_hotspots) {
|
||||||
|
close_read_hotspots(new_hotspots);
|
||||||
new_hotspots.forEach(function (hotspot) {
|
new_hotspots.forEach(function (hotspot) {
|
||||||
hotspot.location = HOTSPOT_LOCATIONS[hotspot.name];
|
hotspot.location = HOTSPOT_LOCATIONS[hotspot.name];
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user