Q:

jQuery show / hide notification if read

I'm trying to show/hide the .notification indicator when all of the .activity__item is marked as read. They can be marked read by clicking each individual item's .activity__button, or by clicking the button to mark all item's as read.
Using the function below I tried identifying whether each item has received the read state (getting the .activity__button--read class) and then hiding the notification if all of the items have been read. This doesn't seem to work here.
Is there an efficient way to show/ hide the notification indicator  when all items have been read either by 

Clicking them individually or 
Marking all as read by clicking
the button?
$(function() {
    if (!$(".activity__button").not(".activity__button--read").length) {
        $(this).closest(".activity__header").find(".notification").hide();
    } else {
      $(this).closest(".activity__header").find(".notification").show();
    }     });

var open = 'fas fa-envelope-open';
var close = 'fas fa-envelope';

$(".activity__button[data-status]").off().on('click', function() {
  var status = $(this).data('status');
  if (status == 'unread') {
    $(this).data('status', 'read').empty().html('<i class="' + open + '"></i>').addClass('activity__button--read');
    $(this).closest(".activity__item").addClass('activity__item--read');
  } else {
    $(this).data('status', 'unread').empty().html('<i class="' + close + '"></i>').removeClass('activity__button--read');
    $(this).closest(".activity__item").removeClass('activity__item--read');
  }
});

$('.mark').off().on('click', function() {
  var status = $(this).data('status');
  if (!status || status == 'unread') {
    $(this).closest(".activity__header").find(".notification").hide();
    $(this).html('Mark all unread').data('status', 'read');
    $(".activity__button[data-status]").each(function() {
      $(this).data('status', 'read').empty().html('<i class="' + open + '"></i>').addClass('activity__button--read');
      $(this).closest(".activity__item").addClass('activity__item--read');
    });
  } else {
    $(this).html('Mark all read').data('status', 'unread');
    $(this).closest(".activity__header").find(".notification").show();
    $(".activity__button[data-status]").each(function() {
      $(this).data('status', 'unread').empty().html('<i class="' + close + '"></i>').removeClass('activity__button--read');
      $(this).closest(".activity__item").removeClass('activity__item--read');
      $(this).closest(".activity__header").find(".notification").show();
    });
  }
});
$(function() {
  if (!$(".activity__button").not(".activity__button--read").length) {
    $(this).closest(".activity__header").find(".notification").hide();
  } else {
    $(this).closest(".activity__header").find(".notification").show();
  }
});
.activity__header {
  display: flex;
}

.activity__item {
  position: relative;
  height: 100px;
  width: 300px;
  border: 1px solid whitesmoke;
  margin-top: -1px;
}

.activity__button {
  cursor: pointer;
  padding: 1rem;
  font-size: 21px;
}

.activity__button svg {
  color: #f8971d;
}

.activity__button.activity__button--read svg {
  color: #47a877;
}

.activity__item--read {
  background: #fafafa !important;
}

button {
  padding: 12px;
  margin: 1rem;
}

.notification {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #cb6f74;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
<script src="https://pro.fontawesome.com/releases/v5.8.1/js/all.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="activity__header">
  <button class="mark" data-status="unread">Mark as Read</button>
  <div class="notification"></div>
</div>
<div>
  <div class="activity__item">
    <div class="activity__button" data-status="unread"><i class="fas fa-envelope"></i>
    </div>
  </div>
  <div class="activity__item">
    <div class="activity__button" data-status="unread"><i class="fas fa-envelope"></i>
    </div>
  </div>

  <div class="activity__item activity__item--read">
    <div class="activity__button activity__button--read" data-status="read">
      <i class="fas fa-envelope-open"></i>
    </div>
  </div>
  <div class="activity__item">
    <div class="activity__button" data-status="unread">
      <i class="fas fa-envelope"></i>
    </div>
  </div>
</div>
</div>

data-status"read"`?

A:

One way would be to check the state of all items each time they are updated
You could use a function like this
function updateNotificationIcon(){
    var $activity_items = $('.activity__item'),
        all_read        = true;

    // Loop through each .activity__item
    $activity_items.each(function(){
        // If item does NOT have the "read" class, set all_read to false
        if(!$(this).hasClass('activity__item--read')){
            all_read = false;
        }
    });

    if(all_read){
        $('.notification').hide();
    }else{
        $('.notification').show();
    }
}

Then just run that function after each change to one of the item's "read" state
In your case I would update your javascript as so:
var open = 'fas fa-envelope-open';
var close = 'fas fa-envelope';

$(".activity__button[data-status]").off().on('click', function() {
    var status = $(this).data('status');
    if (status == 'unread') {
        $(this).data('status', 'read').empty().html('<i class="' + open + '"></i>').addClass('activity__button--read');
        $(this).closest(".activity__item").addClass('activity__item--read');
    } else {
        $(this).data('status', 'unread').empty().html('<i class="' + close + '"></i>').removeClass('activity__button--read');
        $(this).closest(".activity__item").removeClass('activity__item--read');
    }

    // Add here
    updateNotificationIcon();
});

$('.mark').off().on('click', function() {
    var status = $(this).data('status');
    if (!status || status == 'unread') {
        $(this).closest(".activity__header").find(".notification").hide();
        $(this).html('Mark all unread').data('status', 'read');
        $(".activity__button[data-status]").each(function() {
            $(this).data('status', 'read').empty().html('<i class="' + open + '"></i>').addClass('activity__button--read');
            $(this).closest(".activity__item").addClass('activity__item--read');
        });
    } else {
        $(this).html('Mark all read').data('status', 'unread');
        $(this).closest(".activity__header").find(".notification").show();
        $(".activity__button[data-status]").each(function() {
            $(this).data('status', 'unread').empty().html('<i class="' + close + '"></i>').removeClass('activity__button--read');
            $(this).closest(".activity__item").removeClass('activity__item--read');
            $(this).closest(".activity__header").find(".notification").show();
        });
    }

    // Add here
    updateNotificationIcon();
});
$(function() {
    if (!$(".activity__button").not(".activity__button--read").length) {
        $(this).closest(".activity__header").find(".notification").hide();
    } else {
        $(this).closest(".activity__header").find(".notification").show();
    }
});

function updateNotificationIcon() {
    var $activity_items = $('.activity__item'),
        all_read = true;

    // Loop through each .activity__item
    $activity_items.each(function() {
        // If item does NOT have the "read" class, set all_read to false
        if (!$(this).hasClass('activity__item--read')) {
            all_read = false;
        }
    });

    if (all_read) {
        $('.notification').hide();
    } else {
        $('.notification').show();
    }
}

