Skip to content

Commit fbb3f8f

Browse files
committed
Fix MenuReplaceOperation onExecute not being async, and update method references were not private
1 parent 8b692df commit fbb3f8f

7 files changed

Lines changed: 22 additions & 25 deletions

File tree

examples/js/hello-sdl/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152

153153
const cellList = [mainCell1, mainCell2];
154154

155-
await screenManager.setMenu(cellList);
155+
screenManager.setMenu(cellList);
156156
}
157157

158158
async _onHmiStatusListener (onHmiStatus) {

examples/node/hello-sdl-tcp/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class AppClient {
147147

148148
const cellList = [mainCell1, mainCell2];
149149

150-
await screenManager.setMenu(cellList);
150+
screenManager.setMenu(cellList);
151151
}
152152

153153
async _onHmiStatusListener (onHmiStatus) {

examples/node/hello-sdl/AppClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class AppClient {
135135

136136
const cellList = [mainCell1, mainCell2];
137137

138-
await screenManager.setMenu(cellList);
138+
screenManager.setMenu(cellList);
139139
}
140140

141141
_onHmiStatusListener (onHmiStatus) {

examples/webengine/hello-sdl/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157

158158
const cellList = [mainCell1, mainCell2];
159159

160-
await screenManager.setMenu(cellList);
160+
screenManager.setMenu(cellList);
161161
}
162162

163163
async _onSystemCapabilityUpdatedRpcListener (capabilityMessage) {

lib/js/src/manager/screen/_ScreenManagerBase.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ class _ScreenManagerBase extends _SubManagerBase {
666666
* Note: the manager will store a deep copy the menuCells internally to be able to handle future updates correctly
667667
* @param {MenuCell[]} menuCells - The menu cells that are to be sent to the head unit, including their sub-cells.
668668
*/
669-
async setMenu (menuCells) {
670-
await this._menuManagerBase._setMenuCells(menuCells);
669+
setMenu (menuCells) {
670+
this._menuManagerBase._setMenuCells(menuCells);
671671
}
672672

673673
/**

lib/js/src/manager/screen/menu/_MenuManagerBase.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,18 @@ class _MenuManagerBase extends _SubManagerBase {
159159
this._menuCells = cells.map(cell => cell.clone());
160160
const isDynamicMenuUpdateActiveBoolean = this._isDynamicMenuUpdateActive(this._dynamicMenuUpdatesMode, this._displayType);
161161

162-
return new Promise((resolve) => {
163-
const operation = new _MenuReplaceOperation(this._lifecycleManager, this._fileManager, this._windowCapability,
164-
this._currentMenuConfiguration, this._currentMenuCells, this._menuCells, isDynamicMenuUpdateActiveBoolean, new _MenuManagerCompletionListener()
165-
.setOnComplete((success, currentMenuCells) => {
166-
this._currentMenuCells = currentMenuCells;
167-
this._updateMenuReplaceOperationsWithNewCurrentMenu();
168-
console.log('MenuManagerBase - Finished updating menu');
169-
resolve(success);
170-
})
171-
);
172-
173-
// Cancel previous MenuReplaceOperations
174-
this._cancelAllTasks('MenuReplaceOperation');
175-
this._addTask(operation);
176-
});
162+
const operation = new _MenuReplaceOperation(this._lifecycleManager, this._fileManager, this._windowCapability,
163+
this._currentMenuConfiguration, this._currentMenuCells, this._menuCells, isDynamicMenuUpdateActiveBoolean, new _MenuManagerCompletionListener()
164+
.setOnComplete((success, currentMenuCells) => {
165+
this._currentMenuCells = currentMenuCells;
166+
this._updateMenuReplaceOperationsWithNewCurrentMenu();
167+
console.log('MenuManagerBase - Finished updating menu');
168+
})
169+
);
170+
171+
// Cancel previous MenuReplaceOperations
172+
this._cancelAllTasks('MenuReplaceOperation');
173+
this._addTask(operation);
177174
}
178175

179176
/**
@@ -307,7 +304,7 @@ class _MenuManagerBase extends _SubManagerBase {
307304
_updateMenuReplaceOperationsWithNewCurrentMenu () {
308305
this._taskQueue.forEach(task => {
309306
if (task.getName() === 'MenuReplaceOperation') {
310-
task.setCurrentMenu(this._currentMenuCells);
307+
task._setCurrentMenu(this._currentMenuCells);
311308
}
312309
});
313310
}
@@ -329,7 +326,7 @@ class _MenuManagerBase extends _SubManagerBase {
329326
_updateMenuReplaceOperationsWithNewMenuConfiguration () {
330327
this._taskQueue.forEach(task => {
331328
if (task.getName() === 'MenuReplaceOperation') {
332-
task.setMenuConfiguration(this._currentMenuConfiguration);
329+
task._setMenuConfiguration(this._currentMenuConfiguration);
333330
}
334331
});
335332
}

lib/js/src/manager/screen/menu/_MenuReplaceOperation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class _MenuReplaceOperation extends _Task {
6767
* The method that causes the task to run.
6868
* @param {_Task} task - The task instance
6969
*/
70-
onExecute (task) {
71-
this._start();
70+
async onExecute (task) {
71+
await this._start();
7272
}
7373

7474
/**

0 commit comments

Comments
 (0)