diff --git a/src/components/pages/NodeMessagesPage.vue b/src/components/pages/NodeMessagesPage.vue index 9f6c69b..eeeaf46 100644 --- a/src/components/pages/NodeMessagesPage.vue +++ b/src/components/pages/NodeMessagesPage.vue @@ -37,6 +37,18 @@ + +
+
You have {{ offeredFilesCount }} incoming file {{ offeredFilesCount === 1 ? 'transfer' : 'transfers' }}
+
+ + + +
+
+
@@ -53,10 +65,13 @@ import NodeIcon from "../nodes/NodeIcon.vue"; import Page from "./Page.vue"; import NodeUtils from "../../js/NodeUtils.js"; import NodeDropDownMenu from "../nodes/NodeDropDownMenu.vue"; +import TextButton from "../TextButton.vue"; +import FileTransferrer from "../../js/FileTransferrer.js"; export default { name: 'NodeMessagesPage', components: { + TextButton, NodeDropDownMenu, Page, NodeIcon, @@ -102,6 +117,14 @@ export default { subtitle() { return this.node ? this.getNodeLongName(this.node.num) : "Unknown Node"; }, + offeredFilesCount() { + return this.node ? GlobalState.fileTransfers.filter((fileTransfer) => { + const isFromThisNode = fileTransfer.from === this.node.num; + const isIncoming = fileTransfer.direction === FileTransferrer.DIRECTION_INCOMING; + const isOffering = fileTransfer.status === FileTransferrer.STATUS_OFFERING; + return isFromThisNode && isIncoming && isOffering; + }).length : 0; + }, }, }