Skip to content

Commit 3eaf029

Browse files
committed
Fix alert CancelInteraction to use setters and add return statements for in-progress alert conditions
1 parent c641afd commit 3eaf029

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/js/src/manager/screen/utils/_PresentAlertOperation.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,17 @@ class _PresentAlertOperation extends _Task {
267267
if (this._lifecycleManager !== null && this._lifecycleManager.getSdlMsgVersion() !== null && this._lifecycleManager.getSdlMsgVersion().getMajorVersion() < 6) {
268268
console.log('Attempting to cancel this operation in-progress; if the alert is already presented on the module, it cannot be dismissed.');
269269
this.switchStates(_Task.CANCELED);
270+
return;
270271
} else if (!this._isAlertPresented) {
271272
console.log('Alert has not yet been sent to the module. Alert will not be shown.');
273+
this.switchStates(_Task.CANCELED);
274+
return;
272275
}
273276
console.log('Canceling the presented alert');
274277

275-
const cancelInteraction = new CancelInteraction(FunctionID.Alert, this._cancelId);
278+
const cancelInteraction = new CancelInteraction()
279+
.setFunctionIDParam(FunctionID.Alert)
280+
.setCancelID(this._cancelId);
276281
const response = await this._lifecycleManager.sendRpcResolve(cancelInteraction);
277282
if (!response.getSuccess()) {
278283
console.log(`Error canceling the presented alert: ${response.getInfo()}`);

0 commit comments

Comments
 (0)