From 270474ac78129a80994bdb6dfca31ee072267e78 Mon Sep 17 00:00:00 2001 From: Esiur Project Date: Thu, 16 Jun 2022 15:21:08 +0300 Subject: [PATCH] getTemplateByClassName --- package.json | 2 +- src/Net/IIP/DistributedConnection.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 86d38f7..7cd1179 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "esiur", - "version": "2.0.6", + "version": "2.0.7", "description": "Distributed Object Framework", "main": "esiur.js", "type": "module", diff --git a/src/Net/IIP/DistributedConnection.js b/src/Net/IIP/DistributedConnection.js index 0784068..7545c54 100644 --- a/src/Net/IIP/DistributedConnection.js +++ b/src/Net/IIP/DistributedConnection.js @@ -2263,10 +2263,10 @@ export default class DistributedConnection extends IStore { getTemplateByClassName(className) { - let template = this.templates.find((x)=>x.className == className); - if (template != null) - return new AsyncReply(template); - + let templates = this.templates.filter({ className: className }); + + if (templates.length > 0) + return new AsyncReply(templates[0]); else if (this.templateByNameRequests.contains(className)) return this.templateByNameRequests.item(className);