From 9619d1d565b0415c47cf528e81e866f1a24ea23a Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 5 Apr 2023 09:53:22 +0300 Subject: [PATCH] making the navigation methods asynced --- packages/nexus-bridge/src/NexusBaseApplet.js | 26 +++++++------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/packages/nexus-bridge/src/NexusBaseApplet.js b/packages/nexus-bridge/src/NexusBaseApplet.js index fd295aa..b491b16 100644 --- a/packages/nexus-bridge/src/NexusBaseApplet.js +++ b/packages/nexus-bridge/src/NexusBaseApplet.js @@ -393,23 +393,15 @@ export default class NexusBaseApplet { return this.pm.Get('GetSelection') } - _navigate(method) { - if (!this.canInvokeMethod(method)) { - return false - } - const ret = this.pm.ExecuteMethod('InvokeMethod', method) - return ret - } - - nextRecord() { - return this._navigate(this.isListApplet ? 'GotoNext' : 'GotoNextSet') + nextRecord({ async } = {}) { + return this.invokeMethod(this.isListApplet ? 'GotoNext' : 'GotoNextSet', { async }) } - nextRecordSet() { + nextRecordSet({ async } = {}) { if (!this.isListApplet) { return false } - return this._navigate('GotoNextSet') + return this.invokeMethod('GotoNextSet', { async }) } positionOnRow(index, keys, skipIfAlreadyPositioned) { @@ -474,19 +466,19 @@ export default class NexusBaseApplet { return ret // true if success, false is positioning not happened } - prevRecord() { + prevRecord({ async } = {}) { if (this.isListApplet) { // return this.positionOnRow(this.pm.Get('GetSelection') - 1) - return this._navigate('GotoPrevious') + return this.invokeMethod('GotoPrevious', { async }) } - return this._navigate('GotoPreviousSet') + return this.invokeMethod('GotoPreviousSet', { async }) } - prevRecordSet() { + prevRecordSet({ async } = {}) { if (!this.isListApplet) { return false } - return this._navigate('GotoPreviousSet') + return this.invokeMethod('GotoPreviousSet', { async }) } newRecord(cb) {