You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/js/src/manager/screen/choiceset/ChoiceSet.js
+47-13Lines changed: 47 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -37,10 +37,10 @@ class ChoiceSet {
37
37
/**
38
38
* Create a new instance of ChoiceSet
39
39
* Initialize with a title, choices, and listener. It will use the default timeout and layout, all other properties (such as prompts) will be null.
40
-
* WARNING: If you display multiple cells with the same title with the only uniquing property between cells being different `vrCommands` or a feature
41
-
* that is not displayed on the head unit (e.g. if the head unit doesn't display `secondaryArtwork` and that's the only uniquing property between two cells)
40
+
* WARNING: If you display multiple cells with the same title with the only uniquing property between cells being different `vrCommands` or a feature
41
+
* that is not displayed on the head unit (e.g. if the head unit doesn't display `secondaryArtwork` and that's the only uniquing property between two cells)
42
42
* then the cells may appear to be the same to the user in `Manual` mode. This only applies to RPC connections >= 7.1.0.
43
-
* WARNING: On < 7.1.0 connections, the title cell will be automatically modified among cells that have the same title when they are preloaded, so they will
43
+
* WARNING: On < 7.1.0 connections, the title cell will be automatically modified among cells that have the same title when they are preloaded, so they will
44
44
* always appear differently on-screen when they are displayed. Unique text will be created by appending " (2)", " (3)", etc.
console.warn(`ChoiceSet: Attempted to create a choice set with ${this.getChoices().length} choices; Only 1 - 100 choices are valid`);
@@ -245,17 +244,24 @@ class ChoiceSet {
245
244
246
245
/**
247
246
* Get the state timeout
248
-
* @returns {Number} - The timeout
247
+
* @returns {Number} - The timeout of a touch interaction in seconds (Manual/touch only)
249
248
*/
250
249
getTimeout(){
250
+
if(this._timeout===this._TIMEOUT_DEFAULT){
251
+
returnthis.getDefaultTimeout();
252
+
}elseif(this._timeout<this._TIMEOUT_MIN_CAP){
253
+
returnthis._TIMEOUT_MIN_CAP;
254
+
}elseif(this._timeout>this._TIMEOUT_MAX_CAP){
255
+
returnthis._TIMEOUT_MAX_CAP;
256
+
}
251
257
returnthis._timeout;
252
258
}
253
259
254
260
/**
255
261
* Set the state timeout
256
-
* Maps to PerformInteraction.timeout. This applies only to a manual selection (not a voice
257
-
* selection, which has its timeout handled by the system). Defaults to `defaultTimeout`.
258
-
* @param {Number} timeout - The timeout
262
+
* Maps to PerformInteraction.timeout. Timeout in seconds. Defaults to 0, which will use `defaultTimeout`. If this is set below the minimum, it will be capped at 5 seconds. Minimum 5 seconds, maximum 100 seconds. If this is set above the maximum, it will be capped at 100 seconds. Defaults to 0.
263
+
* This applies only to a manual selection (not a voice selection, which has its timeout handled by the system).
264
+
* @param {Number} timeout - The timeout of a touch interaction in seconds (Manual/touch only)
259
265
* @returns {ChoiceSet} - A reference to this instance to support method chaining
0 commit comments