|
@@ -17,7 +17,7 @@ import {
|
17
|
17
|
import { LOAD_CONFIG_ERROR } from '../../base/config';
|
18
|
18
|
import { CONNECTION_FAILED } from '../../base/connection';
|
19
|
19
|
import { MiddlewareRegistry } from '../../base/redux';
|
20
|
|
-import { toURLString } from '../../base/util';
|
|
20
|
+import { getSymbolDescription, toURLString } from '../../base/util';
|
21
|
21
|
import { ENTER_PICTURE_IN_PICTURE } from '../picture-in-picture';
|
22
|
22
|
|
23
|
23
|
/**
|
|
@@ -66,7 +66,7 @@ MiddlewareRegistry.register(store => next => action => {
|
66
|
66
|
break;
|
67
|
67
|
|
68
|
68
|
case ENTER_PICTURE_IN_PICTURE:
|
69
|
|
- _sendEvent(store, _getSymbolDescription(type), /* data */ {});
|
|
69
|
+ _sendEvent(store, getSymbolDescription(type), /* data */ {});
|
70
|
70
|
break;
|
71
|
71
|
|
72
|
72
|
case LOAD_CONFIG_ERROR: {
|
|
@@ -74,7 +74,7 @@ MiddlewareRegistry.register(store => next => action => {
|
74
|
74
|
|
75
|
75
|
_sendEvent(
|
76
|
76
|
store,
|
77
|
|
- _getSymbolDescription(type),
|
|
77
|
+ getSymbolDescription(type),
|
78
|
78
|
/* data */ {
|
79
|
79
|
error: _toErrorString(error),
|
80
|
80
|
url: toURLString(locationURL)
|
|
@@ -110,29 +110,6 @@ function _toErrorString(
|
110
|
110
|
: '');
|
111
|
111
|
}
|
112
|
112
|
|
113
|
|
-/**
|
114
|
|
- * Gets the description of a specific {@code Symbol}.
|
115
|
|
- *
|
116
|
|
- * @param {Symbol} symbol - The {@code Symbol} to retrieve the description of.
|
117
|
|
- * @private
|
118
|
|
- * @returns {string} The description of {@code symbol}.
|
119
|
|
- */
|
120
|
|
-function _getSymbolDescription(symbol: Symbol) {
|
121
|
|
- let description = symbol.toString();
|
122
|
|
-
|
123
|
|
- if (description.startsWith('Symbol(') && description.endsWith(')')) {
|
124
|
|
- description = description.slice(7, -1);
|
125
|
|
- }
|
126
|
|
-
|
127
|
|
- // The polyfill es6-symbol that we use does not appear to comply with the
|
128
|
|
- // Symbol standard and, merely, adds @@ at the beginning of the description.
|
129
|
|
- if (description.startsWith('@@')) {
|
130
|
|
- description = description.slice(2);
|
131
|
|
- }
|
132
|
|
-
|
133
|
|
- return description;
|
134
|
|
-}
|
135
|
|
-
|
136
|
113
|
/**
|
137
|
114
|
* If {@link SET_ROOM} action happens for a valid conference room this method
|
138
|
115
|
* will emit an early {@link CONFERENCE_WILL_JOIN} event to let the external API
|
|
@@ -153,7 +130,7 @@ function _maybeTriggerEarlyConferenceWillJoin(store, action) {
|
153
|
130
|
|
154
|
131
|
isRoomValid(room) && locationURL && _sendEvent(
|
155
|
132
|
store,
|
156
|
|
- _getSymbolDescription(CONFERENCE_WILL_JOIN),
|
|
133
|
+ getSymbolDescription(CONFERENCE_WILL_JOIN),
|
157
|
134
|
/* data */ {
|
158
|
135
|
url: toURLString(locationURL)
|
159
|
136
|
});
|
|
@@ -184,7 +161,7 @@ function _sendConferenceEvent(
|
184
|
161
|
}
|
185
|
162
|
|
186
|
163
|
_swallowEvent(store, action, data)
|
187
|
|
- || _sendEvent(store, _getSymbolDescription(type), data);
|
|
164
|
+ || _sendEvent(store, getSymbolDescription(type), data);
|
188
|
165
|
}
|
189
|
166
|
|
190
|
167
|
/**
|
|
@@ -210,7 +187,7 @@ function _sendConferenceFailedOnConnectionError(store, action) {
|
210
|
187
|
conference => conference.getConnection() !== connection)
|
211
|
188
|
&& _sendEvent(
|
212
|
189
|
store,
|
213
|
|
- _getSymbolDescription(CONFERENCE_FAILED),
|
|
190
|
+ getSymbolDescription(CONFERENCE_FAILED),
|
214
|
191
|
/* data */ {
|
215
|
192
|
url: toURLString(locationURL),
|
216
|
193
|
error: action.error.name
|