Browse Source

fix(ui): invert toast notification icons

Frédéric Guillot 8 months ago
parent
commit
b20a8c97b0
1 changed files with 4 additions and 3 deletions
  1. 4 3
      internal/ui/static/js/app.js

+ 4 - 3
internal/ui/static/js/app.js

@@ -635,7 +635,7 @@ function toggleEntryStatus(element, toasting) {
         setReadStatusButtonState(buttonElement, newStatus);
 
         if (toasting) {
-            showToastNotification(currentStatus, currentStatus === "read" ? buttonElement.dataset.toastUnread : buttonElement.dataset.toastRead);
+            showToastNotification(newStatus, currentStatus === "read" ? buttonElement.dataset.toastUnread : buttonElement.dataset.toastRead);
         }
 
         if (element.classList.contains("item-status-" + currentStatus)) {
@@ -716,13 +716,14 @@ function handleBookmarkAction(element) {
     setButtonToLoadingState(buttonElement);
 
     sendPOSTRequest(buttonElement.dataset.bookmarkUrl).then(() => {
-        const isStarred = buttonElement.dataset.value === "star";
+        const currentState = buttonElement.dataset.value;
+        const isStarred = currentState === "star";
         const newStarStatus = isStarred ? "unstar" : "star";
 
         setBookmarkButtonState(buttonElement, newStarStatus);
 
         if (isEntryView()) {
-            showToastNotification(newStarStatus, buttonElement.dataset[isStarred ? "toastUnstar" : "toastStar"]);
+            showToastNotification(currentState, buttonElement.dataset[isStarred ? "toastUnstar" : "toastStar"]);
         }
     });
 }