Skip to content

Commit

Permalink
feat: improve item received notification to not say the amount if onl… (
Browse files Browse the repository at this point in the history
#157)

feat: improve item received notification to not say the amount if only one
  • Loading branch information
digitalpoppy committed Oct 8, 2023
1 parent 46c27aa commit f8e840a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/narrat/src/stores/inventory-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ export const useInventory = defineStore('inventory', {
} else {
this.items[item.id] = { ...item };
}
const itemName = getItemConfig(item.id).name;
const itemMessage = item.amount > 1 ? `${itemName} x ${item.amount}` : itemName;
useNotifications().addNotification(
`Received item: ${getItemConfig(item.id).name} x ${item.amount}`,
`Received item: ${itemMessage}`,
);
},
enableInteraction(tag?: string) {
Expand Down

0 comments on commit f8e840a

Please sign in to comment.