Skip to content

Commit

Permalink
making the navigation methods asynced
Browse files Browse the repository at this point in the history
  • Loading branch information
OllegK committed Apr 5, 2023
1 parent 5960377 commit 9619d1d
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions packages/nexus-bridge/src/NexusBaseApplet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9619d1d

Please sign in to comment.