sceyt-chat-react-uikit 1.6.9-beta.15 → 1.6.9-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +252 -230
- package/index.modern.js +252 -230
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2854,181 +2854,205 @@ function _catch(body, recover) {
|
|
|
2854
2854
|
return result;
|
|
2855
2855
|
}
|
|
2856
2856
|
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2857
|
+
// Asynchronously await a promise and pass the result to a finally continuation
|
|
2858
|
+
function _finallyRethrows(body, finalizer) {
|
|
2859
|
+
try {
|
|
2860
|
+
var result = body();
|
|
2861
|
+
} catch (e) {
|
|
2862
|
+
return finalizer(true, e);
|
|
2863
|
+
}
|
|
2864
|
+
if (result && result.then) {
|
|
2865
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
2866
|
+
}
|
|
2867
|
+
return finalizer(false, result);
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
var openDatabase = function openDatabase(dbName) {
|
|
2871
|
+
return new Promise(function (resolve, reject) {
|
|
2872
|
+
var request = indexedDB.open(dbName);
|
|
2873
|
+
request.onsuccess = function () {
|
|
2874
|
+
return resolve(request.result);
|
|
2867
2875
|
};
|
|
2868
|
-
|
|
2869
|
-
|
|
2876
|
+
request.onerror = function () {
|
|
2877
|
+
return reject(request.error);
|
|
2870
2878
|
};
|
|
2871
|
-
|
|
2872
|
-
|
|
2879
|
+
});
|
|
2880
|
+
};
|
|
2881
|
+
var runUpgrade = function runUpgrade(dbName, onUpgrade) {
|
|
2882
|
+
try {
|
|
2883
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2884
|
+
var nextVersion = db.version + 1;
|
|
2885
|
+
db.close();
|
|
2886
|
+
return new Promise(function (resolve, reject) {
|
|
2887
|
+
var request = indexedDB.open(dbName, nextVersion);
|
|
2888
|
+
request.onupgradeneeded = function () {
|
|
2889
|
+
var upgradeDb = request.result;
|
|
2890
|
+
onUpgrade(upgradeDb);
|
|
2891
|
+
};
|
|
2892
|
+
request.onsuccess = function () {
|
|
2893
|
+
return resolve(request.result);
|
|
2894
|
+
};
|
|
2895
|
+
request.onerror = function () {
|
|
2896
|
+
return reject(request.error);
|
|
2897
|
+
};
|
|
2898
|
+
request.onblocked = function () {
|
|
2899
|
+
log.warn('IndexedDB upgrade blocked; close other tabs to proceed');
|
|
2900
|
+
};
|
|
2901
|
+
});
|
|
2902
|
+
});
|
|
2903
|
+
} catch (e) {
|
|
2904
|
+
return Promise.reject(e);
|
|
2905
|
+
}
|
|
2906
|
+
};
|
|
2907
|
+
var ensureStore = function ensureStore(dbName, storeName, keyPath) {
|
|
2908
|
+
try {
|
|
2909
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2873
2910
|
if (db.objectStoreNames.contains(storeName)) {
|
|
2874
|
-
|
|
2875
|
-
} else {
|
|
2876
|
-
db.close();
|
|
2877
|
-
currentVersion++;
|
|
2878
|
-
_setDataToDB(dbName, storeName, data, keyPath);
|
|
2911
|
+
return db;
|
|
2879
2912
|
}
|
|
2880
|
-
db.
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2913
|
+
db.close();
|
|
2914
|
+
return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
|
|
2915
|
+
if (!upgradeDb.objectStoreNames.contains(storeName)) {
|
|
2916
|
+
upgradeDb.createObjectStore(storeName, {
|
|
2917
|
+
keyPath: keyPath
|
|
2918
|
+
});
|
|
2919
|
+
}
|
|
2920
|
+
}));
|
|
2921
|
+
});
|
|
2922
|
+
} catch (e) {
|
|
2923
|
+
return Promise.reject(e);
|
|
2885
2924
|
}
|
|
2886
2925
|
};
|
|
2887
|
-
var
|
|
2926
|
+
var awaitTransaction = function awaitTransaction(tx) {
|
|
2888
2927
|
return new Promise(function (resolve, reject) {
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
var db = event.target.result;
|
|
2892
|
-
var transaction = event.target.transaction;
|
|
2893
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2894
|
-
var objectStore = transaction.objectStore(storeName);
|
|
2895
|
-
var request = objectStore.get(keyPath);
|
|
2896
|
-
request.onsuccess = function (event) {
|
|
2897
|
-
var result = event.target.result;
|
|
2898
|
-
resolve(result || '');
|
|
2899
|
-
};
|
|
2900
|
-
request.onerror = function (event) {
|
|
2901
|
-
log.error('Error retrieving data during upgrade: ', event.target.error);
|
|
2902
|
-
resolve('');
|
|
2903
|
-
};
|
|
2904
|
-
} else {
|
|
2905
|
-
db.createObjectStore(storeName, {
|
|
2906
|
-
keyPath: keyPatName
|
|
2907
|
-
});
|
|
2908
|
-
resolve('');
|
|
2909
|
-
}
|
|
2928
|
+
tx.oncomplete = function () {
|
|
2929
|
+
return resolve();
|
|
2910
2930
|
};
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
currentVersion++;
|
|
2914
|
-
resolve(_getDataFromDB(dbName, storeName, keyPath));
|
|
2915
|
-
} else {
|
|
2916
|
-
reject(event);
|
|
2917
|
-
}
|
|
2931
|
+
tx.onerror = function () {
|
|
2932
|
+
return reject(tx.error);
|
|
2918
2933
|
};
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2922
|
-
var transaction = db.transaction(storeName, 'readonly');
|
|
2923
|
-
var objectStore = transaction.objectStore(storeName);
|
|
2924
|
-
var request = objectStore.get(keyPath);
|
|
2925
|
-
request.onsuccess = function (event) {
|
|
2926
|
-
var result = event.target.result;
|
|
2927
|
-
if (result) {
|
|
2928
|
-
db.close();
|
|
2929
|
-
resolve(result);
|
|
2930
|
-
} else {
|
|
2931
|
-
log.info('No data found for the specified keyPathValue.');
|
|
2932
|
-
db.close();
|
|
2933
|
-
resolve('');
|
|
2934
|
-
}
|
|
2935
|
-
};
|
|
2936
|
-
request.onerror = function (event) {
|
|
2937
|
-
db.close();
|
|
2938
|
-
log.error('Error retrieving data: ', event.target.error);
|
|
2939
|
-
};
|
|
2940
|
-
} else {
|
|
2941
|
-
db.close();
|
|
2942
|
-
resolve('');
|
|
2943
|
-
}
|
|
2934
|
+
tx.onabort = function () {
|
|
2935
|
+
return reject(tx.error);
|
|
2944
2936
|
};
|
|
2945
2937
|
});
|
|
2946
2938
|
};
|
|
2947
|
-
var
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
if (
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2939
|
+
var putWithPossibleOutOfLineKey = function putWithPossibleOutOfLineKey(store, value, keyField) {
|
|
2940
|
+
try {
|
|
2941
|
+
if (store.keyPath !== null) {
|
|
2942
|
+
store.put(value);
|
|
2943
|
+
return;
|
|
2944
|
+
}
|
|
2945
|
+
} catch (e) {}
|
|
2946
|
+
var explicitKey = value === null || value === void 0 ? void 0 : value[keyField];
|
|
2947
|
+
if (explicitKey === undefined || explicitKey === null) {
|
|
2948
|
+
throw new Error("IndexedDB put requires explicit key but value has no '" + keyField + "' field");
|
|
2949
|
+
}
|
|
2950
|
+
store.put(value, explicitKey);
|
|
2951
|
+
};
|
|
2952
|
+
var setDataToDB = function setDataToDB(dbName, storeName, data, keyPath) {
|
|
2953
|
+
try {
|
|
2954
|
+
if (!('indexedDB' in window)) {
|
|
2955
|
+
log.info("This browser doesn't support IndexedDB");
|
|
2956
|
+
return Promise.resolve();
|
|
2957
|
+
}
|
|
2958
|
+
return Promise.resolve(ensureStore(dbName, storeName, keyPath)).then(function (db) {
|
|
2959
|
+
var _temp = _finallyRethrows(function () {
|
|
2960
|
+
var tx = db.transaction(storeName, 'readwrite');
|
|
2961
|
+
var store = tx.objectStore(storeName);
|
|
2962
|
+
data.forEach(function (value) {
|
|
2963
|
+
putWithPossibleOutOfLineKey(store, value, keyPath);
|
|
2964
|
+
});
|
|
2965
|
+
return Promise.resolve(awaitTransaction(tx)).then(function () {});
|
|
2966
|
+
}, function (_wasThrown, _result) {
|
|
2967
|
+
db.close();
|
|
2968
|
+
if (_wasThrown) throw _result;
|
|
2969
|
+
return _result;
|
|
2972
2970
|
});
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2971
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
2972
|
+
});
|
|
2973
|
+
} catch (e) {
|
|
2974
|
+
return Promise.reject(e);
|
|
2975
|
+
}
|
|
2976
|
+
};
|
|
2977
|
+
var getDataFromDB = function getDataFromDB(dbName, storeName, keyPathValue, keyPathName) {
|
|
2978
|
+
try {
|
|
2979
|
+
return Promise.resolve(_catch(function () {
|
|
2980
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2981
|
+
var _exit = false;
|
|
2982
|
+
function _temp5(_result2) {
|
|
2983
|
+
if (_exit) return _result2;
|
|
2984
|
+
var tx = db.transaction(storeName, 'readonly');
|
|
2985
|
+
var objectStore = tx.objectStore(storeName);
|
|
2986
|
+
return Promise.resolve(new Promise(function (resolve, reject) {
|
|
2987
|
+
var request = objectStore.get(keyPathValue);
|
|
2988
|
+
request.onsuccess = function () {
|
|
2989
|
+
return resolve(request.result);
|
|
2990
|
+
};
|
|
2991
|
+
request.onerror = function () {
|
|
2992
|
+
return reject(request.error);
|
|
2993
|
+
};
|
|
2994
|
+
})).then(function (result) {
|
|
2995
|
+
db.close();
|
|
2996
|
+
return result || '';
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
var _temp4 = function () {
|
|
3000
|
+
if (!db.objectStoreNames.contains(storeName)) {
|
|
3001
|
+
var _temp3 = function _temp3() {
|
|
3002
|
+
_exit = true;
|
|
3003
|
+
return '';
|
|
3004
|
+
};
|
|
3005
|
+
db.close();
|
|
3006
|
+
var _temp2 = function () {
|
|
3007
|
+
if (keyPathName) {
|
|
3008
|
+
return Promise.resolve(ensureStore(dbName, storeName, keyPathName)).then(function (upgraded) {
|
|
3009
|
+
upgraded.close();
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
}();
|
|
3013
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
3014
|
+
}
|
|
3015
|
+
}();
|
|
3016
|
+
return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
|
|
2984
3017
|
});
|
|
2985
|
-
}
|
|
3018
|
+
}, function (error) {
|
|
3019
|
+
log.error('Error retrieving data: ', error);
|
|
3020
|
+
return '';
|
|
3021
|
+
}));
|
|
3022
|
+
} catch (e) {
|
|
3023
|
+
return Promise.reject(e);
|
|
2986
3024
|
}
|
|
2987
3025
|
};
|
|
2988
3026
|
var getAllStoreNames = function getAllStoreNames(dbName) {
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
openRequest.onupgradeneeded = function (event) {
|
|
2992
|
-
var db = event.target.result;
|
|
2993
|
-
resolve(Array.from(db.objectStoreNames));
|
|
2994
|
-
};
|
|
2995
|
-
openRequest.onerror = function () {
|
|
2996
|
-
log.error('Indexeddb Error ', openRequest.error);
|
|
2997
|
-
reject(openRequest.error);
|
|
2998
|
-
};
|
|
2999
|
-
openRequest.onsuccess = function (event) {
|
|
3000
|
-
var db = event.target.result;
|
|
3027
|
+
try {
|
|
3028
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
3001
3029
|
try {
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
resolve(storeNames);
|
|
3005
|
-
} catch (error) {
|
|
3030
|
+
return Array.from(db.objectStoreNames);
|
|
3031
|
+
} finally {
|
|
3006
3032
|
db.close();
|
|
3007
|
-
reject(error);
|
|
3008
3033
|
}
|
|
3009
|
-
};
|
|
3010
|
-
})
|
|
3034
|
+
});
|
|
3035
|
+
} catch (e) {
|
|
3036
|
+
return Promise.reject(e);
|
|
3037
|
+
}
|
|
3011
3038
|
};
|
|
3012
3039
|
var deleteStore = function deleteStore(dbName, storeName) {
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
var db = event.target.result;
|
|
3017
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
3018
|
-
db.deleteObjectStore(storeName);
|
|
3019
|
-
currentVersion++;
|
|
3020
|
-
}
|
|
3021
|
-
};
|
|
3022
|
-
openRequest.onerror = function () {
|
|
3023
|
-
log.error('Indexeddb Error ', openRequest.error);
|
|
3024
|
-
reject(openRequest.error);
|
|
3025
|
-
};
|
|
3026
|
-
openRequest.onsuccess = function (event) {
|
|
3027
|
-
var db = event.target.result;
|
|
3040
|
+
try {
|
|
3041
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
3042
|
+
var shouldDelete = db.objectStoreNames.contains(storeName);
|
|
3028
3043
|
db.close();
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3044
|
+
if (!shouldDelete) return;
|
|
3045
|
+
return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
|
|
3046
|
+
if (upgradeDb.objectStoreNames.contains(storeName)) {
|
|
3047
|
+
upgradeDb.deleteObjectStore(storeName);
|
|
3048
|
+
}
|
|
3049
|
+
})).then(function (upgraded) {
|
|
3050
|
+
upgraded.close();
|
|
3051
|
+
});
|
|
3052
|
+
});
|
|
3053
|
+
} catch (e) {
|
|
3054
|
+
return Promise.reject(e);
|
|
3055
|
+
}
|
|
3032
3056
|
};
|
|
3033
3057
|
|
|
3034
3058
|
var METADATA_DB_NAME = 'sceyt-metadata-db';
|
|
@@ -3051,7 +3075,7 @@ var storeMetadata = function storeMetadata(url, metadata) {
|
|
|
3051
3075
|
expiresAt: Date.now() + CACHE_DURATION
|
|
3052
3076
|
});
|
|
3053
3077
|
var _temp = _catch(function () {
|
|
3054
|
-
return Promise.resolve(
|
|
3078
|
+
return Promise.resolve(setDataToDB(METADATA_DB_NAME, currentMonth, [metadataRecord], 'url')).then(function () {});
|
|
3055
3079
|
}, function (error) {
|
|
3056
3080
|
console.error('Failed to store metadata in IndexedDB:', error);
|
|
3057
3081
|
});
|
|
@@ -3099,7 +3123,7 @@ var cleanupOldMonthsMetadata = function cleanupOldMonthsMetadata() {
|
|
|
3099
3123
|
var getMetadata = function getMetadata(url) {
|
|
3100
3124
|
return Promise.resolve(_catch(function () {
|
|
3101
3125
|
var currentMonth = getCurrentMonthKey();
|
|
3102
|
-
return Promise.resolve(
|
|
3126
|
+
return Promise.resolve(getDataFromDB(METADATA_DB_NAME, currentMonth, url, 'url')).then(function (result) {
|
|
3103
3127
|
if (!result || typeof result === 'string') {
|
|
3104
3128
|
return null;
|
|
3105
3129
|
}
|
|
@@ -10937,11 +10961,11 @@ var defaultTheme = {
|
|
|
10937
10961
|
light: '#D9D9DF',
|
|
10938
10962
|
dark: '#303032'
|
|
10939
10963
|
}, _colors[THEME_COLORS.OVERLAY_BACKGROUND] = {
|
|
10940
|
-
light: '
|
|
10941
|
-
dark: '
|
|
10964
|
+
light: '#111539',
|
|
10965
|
+
dark: '#111539'
|
|
10942
10966
|
}, _colors[THEME_COLORS.OVERLAY_BACKGROUND_2] = {
|
|
10943
|
-
light: '
|
|
10944
|
-
dark: '
|
|
10967
|
+
light: '#111539',
|
|
10968
|
+
dark: '#111539'
|
|
10945
10969
|
}, _colors[THEME_COLORS.WARNING] = {
|
|
10946
10970
|
light: '#FA4C56',
|
|
10947
10971
|
dark: '#FA4C56'
|
|
@@ -11267,11 +11291,12 @@ var sendTypingAC = function sendTypingAC(state) {
|
|
|
11267
11291
|
}
|
|
11268
11292
|
};
|
|
11269
11293
|
};
|
|
11270
|
-
var sendRecordingAC = function sendRecordingAC(state) {
|
|
11294
|
+
var sendRecordingAC = function sendRecordingAC(state, channelId) {
|
|
11271
11295
|
return {
|
|
11272
11296
|
type: SEND_RECORDING,
|
|
11273
11297
|
payload: {
|
|
11274
|
-
state: state
|
|
11298
|
+
state: state,
|
|
11299
|
+
channelId: channelId
|
|
11275
11300
|
}
|
|
11276
11301
|
};
|
|
11277
11302
|
};
|
|
@@ -12897,7 +12922,7 @@ var UploadPercent = styled__default.span(_templateObject38 || (_templateObject38
|
|
|
12897
12922
|
}, function (props) {
|
|
12898
12923
|
return props.fileAttachment || props.isRepliedMessage || props.isDetailsView ? '40px' : '56px';
|
|
12899
12924
|
}, function (props) {
|
|
12900
|
-
return props.backgroundColor + "
|
|
12925
|
+
return props.backgroundColor + "66";
|
|
12901
12926
|
}, function (props) {
|
|
12902
12927
|
return props.borderRadius ? props.borderRadius : props.fileAttachment ? '8px' : props.isRepliedMessage ? '4px' : ' 50%';
|
|
12903
12928
|
}, function (props) {
|
|
@@ -16218,47 +16243,43 @@ function sendTyping(action) {
|
|
|
16218
16243
|
}, _marked22, null, [[3, 7]]);
|
|
16219
16244
|
}
|
|
16220
16245
|
function sendRecording(action) {
|
|
16221
|
-
var state,
|
|
16246
|
+
var _action$payload, state, channelId, channel, _t24;
|
|
16222
16247
|
return _regenerator().w(function (_context23) {
|
|
16223
16248
|
while (1) switch (_context23.p = _context23.n) {
|
|
16224
16249
|
case 0:
|
|
16225
|
-
|
|
16250
|
+
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
16226
16251
|
_context23.n = 1;
|
|
16227
|
-
return effects.call(
|
|
16252
|
+
return effects.call(getChannelFromMap, channelId);
|
|
16228
16253
|
case 1:
|
|
16229
|
-
activeChannelId = _context23.v;
|
|
16230
|
-
_context23.n = 2;
|
|
16231
|
-
return effects.call(getChannelFromMap, activeChannelId);
|
|
16232
|
-
case 2:
|
|
16233
16254
|
channel = _context23.v;
|
|
16234
|
-
_context23.p =
|
|
16255
|
+
_context23.p = 2;
|
|
16235
16256
|
if (!channel) {
|
|
16236
|
-
_context23.n =
|
|
16257
|
+
_context23.n = 5;
|
|
16237
16258
|
break;
|
|
16238
16259
|
}
|
|
16239
16260
|
if (!state) {
|
|
16240
|
-
_context23.n =
|
|
16261
|
+
_context23.n = 4;
|
|
16241
16262
|
break;
|
|
16242
16263
|
}
|
|
16243
|
-
_context23.n =
|
|
16264
|
+
_context23.n = 3;
|
|
16244
16265
|
return effects.call(channel.startRecording);
|
|
16245
|
-
case
|
|
16246
|
-
_context23.n =
|
|
16266
|
+
case 3:
|
|
16267
|
+
_context23.n = 5;
|
|
16247
16268
|
break;
|
|
16248
|
-
case
|
|
16249
|
-
_context23.n =
|
|
16269
|
+
case 4:
|
|
16270
|
+
_context23.n = 5;
|
|
16250
16271
|
return effects.call(channel.stopRecording);
|
|
16251
|
-
case
|
|
16252
|
-
_context23.n =
|
|
16272
|
+
case 5:
|
|
16273
|
+
_context23.n = 7;
|
|
16253
16274
|
break;
|
|
16254
|
-
case
|
|
16255
|
-
_context23.p =
|
|
16275
|
+
case 6:
|
|
16276
|
+
_context23.p = 6;
|
|
16256
16277
|
_t24 = _context23.v;
|
|
16257
16278
|
log.error('ERROR in send recording', _t24);
|
|
16258
|
-
case
|
|
16279
|
+
case 7:
|
|
16259
16280
|
return _context23.a(2);
|
|
16260
16281
|
}
|
|
16261
|
-
}, _marked23, null, [[
|
|
16282
|
+
}, _marked23, null, [[2, 6]]);
|
|
16262
16283
|
}
|
|
16263
16284
|
function clearHistory(action) {
|
|
16264
16285
|
var payload, channelId, channel, activeChannelId, groupName, _t25;
|
|
@@ -17239,7 +17260,7 @@ function sendMessage(action) {
|
|
|
17239
17260
|
} else {
|
|
17240
17261
|
var pendingAttachment = getPendingAttachment(attachment.tid);
|
|
17241
17262
|
if (!attachment.cachedUrl) {
|
|
17242
|
-
|
|
17263
|
+
setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, updatedAttachment, {
|
|
17243
17264
|
checksum: pendingAttachment.checksum
|
|
17244
17265
|
})], 'checksum');
|
|
17245
17266
|
}
|
|
@@ -17397,7 +17418,7 @@ function sendMessage(action) {
|
|
|
17397
17418
|
});
|
|
17398
17419
|
pendingAttachment = getPendingAttachment(messageAttachment[k].tid);
|
|
17399
17420
|
if (!messageAttachment[k].cachedUrl) {
|
|
17400
|
-
|
|
17421
|
+
setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, messageResponse.attachments[k], {
|
|
17401
17422
|
checksum: pendingAttachment.checksum || (pendingAttachment === null || pendingAttachment === void 0 ? void 0 : pendingAttachment.file)
|
|
17402
17423
|
})], 'checksum');
|
|
17403
17424
|
}
|
|
@@ -21014,15 +21035,15 @@ var Channel = function Channel(_ref3) {
|
|
|
21014
21035
|
items: filteredItems,
|
|
21015
21036
|
isTyping: !!filteredItems.find(function (item) {
|
|
21016
21037
|
return item.typingState;
|
|
21038
|
+
}),
|
|
21039
|
+
isRecording: !!filteredItems.find(function (item) {
|
|
21040
|
+
return item.recordingState;
|
|
21017
21041
|
})
|
|
21018
21042
|
};
|
|
21019
21043
|
}, [typingOrRecordingIndicator]);
|
|
21020
|
-
var isTypingOrRecording = React.useMemo(function () {
|
|
21021
|
-
return typingOrRecording.items.length > 0;
|
|
21022
|
-
}, [typingOrRecording]);
|
|
21023
21044
|
var MessageText = React.useMemo(function () {
|
|
21024
21045
|
return /*#__PURE__*/React__default.createElement(ChannelMessageText, {
|
|
21025
|
-
isTypingOrRecording:
|
|
21046
|
+
isTypingOrRecording: (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording),
|
|
21026
21047
|
user: user,
|
|
21027
21048
|
contactsMap: contactsMap,
|
|
21028
21049
|
getFromContacts: getFromContacts,
|
|
@@ -21036,7 +21057,7 @@ var Channel = function Channel(_ref3) {
|
|
|
21036
21057
|
lastMessage: lastMessage,
|
|
21037
21058
|
isDirectChannel: isDirectChannel
|
|
21038
21059
|
});
|
|
21039
|
-
}, [
|
|
21060
|
+
}, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel]);
|
|
21040
21061
|
return /*#__PURE__*/React__default.createElement(Container$2, {
|
|
21041
21062
|
theme: theme,
|
|
21042
21063
|
selectedChannel: channel.id === activeChannel.id,
|
|
@@ -21079,9 +21100,9 @@ var Channel = function Channel(_ref3) {
|
|
|
21079
21100
|
unreadMentions: !!(channel.newMentionCount && channel.newMentionCount > 0),
|
|
21080
21101
|
fontSize: channelLastMessageFontSize,
|
|
21081
21102
|
height: channelLastMessageHeight
|
|
21082
|
-
},
|
|
21103
|
+
}, typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping || typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording ? !isDirectChannel ? (/*#__PURE__*/React__default.createElement(LastMessageAuthor, {
|
|
21083
21104
|
typing: typingOrRecording.isTyping,
|
|
21084
|
-
recording:
|
|
21105
|
+
recording: typingOrRecording.isRecording,
|
|
21085
21106
|
color: textPrimary
|
|
21086
21107
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
21087
21108
|
ref: messageAuthorRef
|
|
@@ -21099,11 +21120,11 @@ var Channel = function Channel(_ref3) {
|
|
|
21099
21120
|
color: textPrimary
|
|
21100
21121
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
21101
21122
|
ref: messageAuthorRef
|
|
21102
|
-
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !
|
|
21123
|
+
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (isDirectChannel ? !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (draftMessageText || lastMessage.user && lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? channel.newReactions[0].user && channel.newReactions[0].user.id === user.id : lastMessage.user.id === user.id)) : ((typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording)) && draftMessageText || lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && lastMessage.type !== 'system') && (/*#__PURE__*/React__default.createElement(Points, {
|
|
21103
21124
|
color: draftMessageText && warningColor || textPrimary
|
|
21104
21125
|
}, ": ")), /*#__PURE__*/React__default.createElement(LastMessageText, {
|
|
21105
21126
|
color: textSecondary,
|
|
21106
|
-
withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && !
|
|
21127
|
+
withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && (!(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) || !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording)),
|
|
21107
21128
|
noBody: lastMessage && !lastMessage.body,
|
|
21108
21129
|
deletedMessage: lastMessage && lastMessage.state === MESSAGE_STATUS.DELETE
|
|
21109
21130
|
}, MessageText)))), /*#__PURE__*/React__default.createElement(ChannelStatus, {
|
|
@@ -21619,7 +21640,7 @@ var Container$4 = styled__default.div(_templateObject$8 || (_templateObject$8 =
|
|
|
21619
21640
|
}, function (props) {
|
|
21620
21641
|
return props.height ? props.height + "px" : '0px';
|
|
21621
21642
|
}, function (props) {
|
|
21622
|
-
return props.background + "
|
|
21643
|
+
return props.background + "66";
|
|
21623
21644
|
});
|
|
21624
21645
|
|
|
21625
21646
|
var _templateObject$9, _templateObject2$8, _templateObject3$5, _templateObject4$5, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject0$2, _templateObject1$2;
|
|
@@ -24063,7 +24084,7 @@ var Container$a = styled__default.div(_templateObject$j || (_templateObject$j =
|
|
|
24063
24084
|
}, function (props) {
|
|
24064
24085
|
return props.dateDividerTextColor;
|
|
24065
24086
|
}, function (props) {
|
|
24066
|
-
return props.dateDividerBackgroundColor + "
|
|
24087
|
+
return props.dateDividerBackgroundColor + "66";
|
|
24067
24088
|
}, function (props) {
|
|
24068
24089
|
return props.dateDividerBorderRadius || '14px';
|
|
24069
24090
|
}, function (props) {
|
|
@@ -25593,7 +25614,7 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
25593
25614
|
text: '',
|
|
25594
25615
|
styles: {
|
|
25595
25616
|
background: {
|
|
25596
|
-
fill: overlayBackground2 + "
|
|
25617
|
+
fill: overlayBackground2 + "66"
|
|
25597
25618
|
},
|
|
25598
25619
|
path: {
|
|
25599
25620
|
stroke: textOnPrimary,
|
|
@@ -25848,7 +25869,7 @@ var Container$c = styled__default.div(_templateObject$p || (_templateObject$p =
|
|
|
25848
25869
|
}, function (props) {
|
|
25849
25870
|
return props.textColor;
|
|
25850
25871
|
}, function (props) {
|
|
25851
|
-
return props.backgroundColor + "
|
|
25872
|
+
return props.backgroundColor + "66";
|
|
25852
25873
|
}, function (props) {
|
|
25853
25874
|
return props.border;
|
|
25854
25875
|
}, function (props) {
|
|
@@ -26896,7 +26917,7 @@ var VideoTime = styled__default.div(_templateObject2$o || (_templateObject2$o =
|
|
|
26896
26917
|
}, function (props) {
|
|
26897
26918
|
return props.isRepliedMessage ? '0 3px' : '4px 6px';
|
|
26898
26919
|
}, function (props) {
|
|
26899
|
-
return props.messageTimeBackgroundColor + "
|
|
26920
|
+
return props.messageTimeBackgroundColor + "66";
|
|
26900
26921
|
}, function (props) {
|
|
26901
26922
|
return props.color;
|
|
26902
26923
|
}, function (props) {
|
|
@@ -29510,7 +29531,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29510
29531
|
text: '',
|
|
29511
29532
|
styles: {
|
|
29512
29533
|
background: {
|
|
29513
|
-
fill: overlayBackground2 + "
|
|
29534
|
+
fill: overlayBackground2 + "66"
|
|
29514
29535
|
},
|
|
29515
29536
|
path: {
|
|
29516
29537
|
stroke: textOnPrimary,
|
|
@@ -29560,7 +29581,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29560
29581
|
text: '',
|
|
29561
29582
|
styles: {
|
|
29562
29583
|
background: {
|
|
29563
|
-
fill: overlayBackground2 + "
|
|
29584
|
+
fill: overlayBackground2 + "66"
|
|
29564
29585
|
},
|
|
29565
29586
|
path: {
|
|
29566
29587
|
stroke: textOnPrimary,
|
|
@@ -29667,7 +29688,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29667
29688
|
text: '',
|
|
29668
29689
|
styles: {
|
|
29669
29690
|
background: {
|
|
29670
|
-
fill: overlayBackground2 + "
|
|
29691
|
+
fill: overlayBackground2 + "66"
|
|
29671
29692
|
},
|
|
29672
29693
|
path: {
|
|
29673
29694
|
stroke: textOnPrimary,
|
|
@@ -30839,7 +30860,7 @@ var MessageStatusAndTime = function MessageStatusAndTime(_ref) {
|
|
|
30839
30860
|
}))));
|
|
30840
30861
|
};
|
|
30841
30862
|
var MessageStatusAndTime$1 = /*#__PURE__*/React__default.memo(MessageStatusAndTime, function (prevProps, nextProps) {
|
|
30842
|
-
return prevProps.message.state === nextProps.message.state && prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.createdAt === nextProps.message.createdAt && prevProps.showMessageTimeAndStatusOnlyOnHover === nextProps.showMessageTimeAndStatusOnlyOnHover && prevProps.messageStatusSize === nextProps.messageStatusSize && prevProps.messageStatusColor === nextProps.messageStatusColor && prevProps.messageReadStatusColor === nextProps.messageReadStatusColor && prevProps.messageStateFontSize === nextProps.messageStateFontSize && prevProps.messageStateColor === nextProps.messageStateColor && prevProps.messageTimeFontSize === nextProps.messageTimeFontSize && prevProps.messageStatusAndTimeLineHeight === nextProps.messageStatusAndTimeLineHeight && prevProps.messageTimeColor === nextProps.messageTimeColor && prevProps.messageTimeVisible === nextProps.messageTimeVisible && prevProps.messageStatusVisible === nextProps.messageStatusVisible && prevProps.ownMessageOnRightSide === nextProps.ownMessageOnRightSide && prevProps.bottomOfMessage === nextProps.bottomOfMessage && prevProps.marginBottom === nextProps.marginBottom && prevProps.messageTimeColorOnAttachment === nextProps.messageTimeColorOnAttachment;
|
|
30863
|
+
return prevProps.message.state === nextProps.message.state && prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.createdAt === nextProps.message.createdAt && prevProps.showMessageTimeAndStatusOnlyOnHover === nextProps.showMessageTimeAndStatusOnlyOnHover && prevProps.messageStatusSize === nextProps.messageStatusSize && prevProps.messageStatusColor === nextProps.messageStatusColor && prevProps.messageReadStatusColor === nextProps.messageReadStatusColor && prevProps.messageStateFontSize === nextProps.messageStateFontSize && prevProps.messageStateColor === nextProps.messageStateColor && prevProps.messageTimeFontSize === nextProps.messageTimeFontSize && prevProps.messageStatusAndTimeLineHeight === nextProps.messageStatusAndTimeLineHeight && prevProps.messageTimeColor === nextProps.messageTimeColor && prevProps.messageTimeVisible === nextProps.messageTimeVisible && prevProps.messageStatusVisible === nextProps.messageStatusVisible && prevProps.ownMessageOnRightSide === nextProps.ownMessageOnRightSide && prevProps.bottomOfMessage === nextProps.bottomOfMessage && prevProps.marginBottom === nextProps.marginBottom && prevProps.messageTimeColorOnAttachment === nextProps.messageTimeColorOnAttachment && prevProps.withAttachment === nextProps.withAttachment;
|
|
30843
30864
|
});
|
|
30844
30865
|
var MessageStatus = styled__default.span(_templateObject$z || (_templateObject$z = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
|
|
30845
30866
|
return props.height || '14px';
|
|
@@ -30858,7 +30879,7 @@ var MessageStatusAndTimeContainer = styled__default.span(_templateObject3$o || (
|
|
|
30858
30879
|
}, function (props) {
|
|
30859
30880
|
return props.withAttachment && '4px 6px';
|
|
30860
30881
|
}, function (props) {
|
|
30861
|
-
return props.withAttachment && !props.fileAttachment && props.messageTimeBackgroundColor + "
|
|
30882
|
+
return props.withAttachment && !props.fileAttachment && props.messageTimeBackgroundColor + "66";
|
|
30862
30883
|
}, function (props) {
|
|
30863
30884
|
return props.lineHeight || '14px';
|
|
30864
30885
|
}, function (props) {
|
|
@@ -30914,7 +30935,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
30914
30935
|
var queryBuilder = new client.MessageLinkOGQueryBuilder(url);
|
|
30915
30936
|
return Promise.resolve(queryBuilder.build()).then(function (query) {
|
|
30916
30937
|
return Promise.resolve(query.loadOGData()).then(function (metadata) {
|
|
30917
|
-
return Promise.resolve(storeMetadata(url.replace('https://', ''), metadata)).then(function () {
|
|
30938
|
+
return Promise.resolve(storeMetadata(url.replace('https://', '').replace('http://', ''), metadata)).then(function () {
|
|
30918
30939
|
setMetadata(metadata);
|
|
30919
30940
|
});
|
|
30920
30941
|
});
|
|
@@ -30936,7 +30957,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
30936
30957
|
if (attachment !== null && attachment !== void 0 && attachment.id && !metadata) {
|
|
30937
30958
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
30938
30959
|
if (url) {
|
|
30939
|
-
getMetadata(url.replace('https://', '')).then(function (cachedMetadata) {
|
|
30960
|
+
getMetadata(url.replace('https://', '').replace('http://', '')).then(function (cachedMetadata) {
|
|
30940
30961
|
try {
|
|
30941
30962
|
if (cachedMetadata) {
|
|
30942
30963
|
setMetadata(cachedMetadata);
|
|
@@ -33337,7 +33358,7 @@ var MessageTopDate = styled__default.div(_templateObject4$o || (_templateObject4
|
|
|
33337
33358
|
}, function (props) {
|
|
33338
33359
|
return props.dateDividerTextColor;
|
|
33339
33360
|
}, function (props) {
|
|
33340
|
-
return props.dateDividerBackgroundColor + "
|
|
33361
|
+
return props.dateDividerBackgroundColor + "66";
|
|
33341
33362
|
}, function (props) {
|
|
33342
33363
|
return props.dateDividerBorder;
|
|
33343
33364
|
}, function (props) {
|
|
@@ -35381,19 +35402,19 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35381
35402
|
}, [currentRecordedFile]);
|
|
35382
35403
|
var dispatch = reactRedux.useDispatch();
|
|
35383
35404
|
var handleStartRecording = function handleStartRecording() {
|
|
35384
|
-
dispatch(sendRecordingAC(true));
|
|
35405
|
+
dispatch(sendRecordingAC(true, currentChannelId));
|
|
35385
35406
|
if (sendingInterval) {
|
|
35386
35407
|
clearInterval(sendingInterval);
|
|
35387
35408
|
setSendingInterval(null);
|
|
35388
35409
|
return;
|
|
35389
35410
|
}
|
|
35390
35411
|
var interval = setInterval(function () {
|
|
35391
|
-
dispatch(sendRecordingAC(true));
|
|
35412
|
+
dispatch(sendRecordingAC(true, currentChannelId));
|
|
35392
35413
|
}, 1000);
|
|
35393
35414
|
setSendingInterval(interval);
|
|
35394
35415
|
};
|
|
35395
35416
|
var handleStopRecording = function handleStopRecording() {
|
|
35396
|
-
dispatch(sendRecordingAC(false));
|
|
35417
|
+
dispatch(sendRecordingAC(false, currentChannelId));
|
|
35397
35418
|
if (sendingInterval) {
|
|
35398
35419
|
clearInterval(sendingInterval);
|
|
35399
35420
|
setSendingInterval(null);
|
|
@@ -35547,10 +35568,9 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35547
35568
|
return Promise.resolve(_catch(function () {
|
|
35548
35569
|
var _wavesurfer$current3;
|
|
35549
35570
|
function _temp3(_result3) {
|
|
35571
|
+
var _wavesurfer$current$i, _wavesurfer$current$i2;
|
|
35550
35572
|
if (_exit) return _result3;
|
|
35551
|
-
|
|
35552
|
-
return;
|
|
35553
|
-
}
|
|
35573
|
+
setCurrentTime(((_wavesurfer$current$i = wavesurfer.current[id]) === null || _wavesurfer$current$i === void 0 ? void 0 : (_wavesurfer$current$i2 = _wavesurfer$current$i.decodedData) === null || _wavesurfer$current$i2 === void 0 ? void 0 : _wavesurfer$current$i2.duration) || 0);
|
|
35554
35574
|
wavesurfer.current[id].on('ready', function () {
|
|
35555
35575
|
setRecordingIsReadyToPlay(true);
|
|
35556
35576
|
var audioDuration = wavesurfer.current[id].getDuration();
|
|
@@ -35662,7 +35682,6 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35662
35682
|
recorder.stop().getMp3().then(function (_ref4) {
|
|
35663
35683
|
var buffer = _ref4[0],
|
|
35664
35684
|
blob = _ref4[1];
|
|
35665
|
-
setCurrentTime(0);
|
|
35666
35685
|
var file = new File(buffer, 'record.mp3', {
|
|
35667
35686
|
type: blob.type,
|
|
35668
35687
|
lastModified: Date.now()
|
|
@@ -35728,15 +35747,12 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35728
35747
|
if ((_wavesurfer$current5 = wavesurfer.current) !== null && _wavesurfer$current5 !== void 0 && _wavesurfer$current5[cId || currentChannelId]) {
|
|
35729
35748
|
if (!wavesurfer.current[cId || currentChannelId].isPlaying()) {
|
|
35730
35749
|
setPlayAudio(true);
|
|
35731
|
-
handleStartRecording();
|
|
35732
35750
|
intervalRef.current[cId || currentChannelId] = setInterval(function () {
|
|
35733
35751
|
var currentTime = wavesurfer.current[cId || currentChannelId].getCurrentTime();
|
|
35734
35752
|
if (currentTime >= 0) {
|
|
35735
35753
|
setCurrentTime(currentTime);
|
|
35736
35754
|
}
|
|
35737
35755
|
}, 10);
|
|
35738
|
-
} else {
|
|
35739
|
-
handleStopRecording();
|
|
35740
35756
|
}
|
|
35741
35757
|
wavesurfer.current[cId || currentChannelId].playPause();
|
|
35742
35758
|
}
|
|
@@ -35852,6 +35868,7 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35852
35868
|
setRecordedFile(audioRecording || null);
|
|
35853
35869
|
setRecordingIsReadyToPlay(!!audioRecording);
|
|
35854
35870
|
}
|
|
35871
|
+
handleStopRecording();
|
|
35855
35872
|
setCurrentChannelId(channelId);
|
|
35856
35873
|
}, [channelId]);
|
|
35857
35874
|
return /*#__PURE__*/React__default.createElement(Container$j, {
|
|
@@ -36875,7 +36892,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36875
36892
|
}
|
|
36876
36893
|
var dataFromDb;
|
|
36877
36894
|
var _temp11 = _catch(function () {
|
|
36878
|
-
return Promise.resolve(
|
|
36895
|
+
return Promise.resolve(getDataFromDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, checksumHash, 'checksum')).then(function (_getDataFromDB) {
|
|
36879
36896
|
dataFromDb = _getDataFromDB;
|
|
36880
36897
|
});
|
|
36881
36898
|
}, function (e) {
|
|
@@ -37215,16 +37232,21 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37215
37232
|
}
|
|
37216
37233
|
};
|
|
37217
37234
|
}, []);
|
|
37218
|
-
var
|
|
37219
|
-
|
|
37235
|
+
var typingOrRecording = React.useMemo(function () {
|
|
37236
|
+
var dataValues = typingOrRecordingIndicator ? Object.values(typingOrRecordingIndicator) : [];
|
|
37237
|
+
var filteredItems = dataValues.filter(function (item) {
|
|
37220
37238
|
return item.typingState || item.recordingState;
|
|
37221
|
-
}) : [];
|
|
37222
|
-
}, [typingOrRecordingIndicator]);
|
|
37223
|
-
var isTyping = React.useMemo(function () {
|
|
37224
|
-
return !!filteredTypingOrRecordingIndicator.find(function (item) {
|
|
37225
|
-
return item.typingState;
|
|
37226
37239
|
});
|
|
37227
|
-
|
|
37240
|
+
return {
|
|
37241
|
+
items: filteredItems,
|
|
37242
|
+
isTyping: !!filteredItems.find(function (item) {
|
|
37243
|
+
return item.typingState;
|
|
37244
|
+
}),
|
|
37245
|
+
isRecording: !!filteredItems.find(function (item) {
|
|
37246
|
+
return item.recordingState;
|
|
37247
|
+
})
|
|
37248
|
+
};
|
|
37249
|
+
}, [typingOrRecordingIndicator]);
|
|
37228
37250
|
var formatTypingIndicatorText = function formatTypingIndicatorText(users, maxShownUsers) {
|
|
37229
37251
|
if (maxShownUsers === void 0) {
|
|
37230
37252
|
maxShownUsers = 3;
|
|
@@ -37233,7 +37255,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37233
37255
|
if (users.length === 1) {
|
|
37234
37256
|
var _user = users[0];
|
|
37235
37257
|
var userName = makeUsername(getFromContacts && _user.from && contactsMap[_user.from.id], _user.from, getFromContacts);
|
|
37236
|
-
return "" + userName + (isTyping ? activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is typing' : '' : activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is recording' : '');
|
|
37258
|
+
return "" + userName + (typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping ? activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is typing' : '' : activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is recording' : '');
|
|
37237
37259
|
}
|
|
37238
37260
|
if (users.length <= maxShownUsers) {
|
|
37239
37261
|
var userNames = users.map(function (user) {
|
|
@@ -37303,8 +37325,8 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37303
37325
|
}, "Join")) : (activeChannel.type === DEFAULT_CHANNEL_TYPE.BROADCAST || activeChannel.type === DEFAULT_CHANNEL_TYPE.PUBLIC ? !(activeChannel.userRole === 'admin' || activeChannel.userRole === 'owner') : activeChannel.type !== DEFAULT_CHANNEL_TYPE.DIRECT && !checkActionPermission('sendMessage')) ? (/*#__PURE__*/React__default.createElement(ReadOnlyCont, {
|
|
37304
37326
|
color: textPrimary,
|
|
37305
37327
|
iconColor: accentColor
|
|
37306
|
-
}, /*#__PURE__*/React__default.createElement(SvgEye, null), " Read only")) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TypingIndicator$1, null,
|
|
37307
|
-
from:
|
|
37328
|
+
}, /*#__PURE__*/React__default.createElement(SvgEye, null), " Read only")) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TypingIndicator$1, null, (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items.length) > 0 && (CustomTypingIndicator ? (/*#__PURE__*/React__default.createElement(CustomTypingIndicator, {
|
|
37329
|
+
from: typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items.map(function (item) {
|
|
37308
37330
|
return {
|
|
37309
37331
|
id: item.from.id,
|
|
37310
37332
|
name: item.from.name,
|
|
@@ -37314,7 +37336,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37314
37336
|
})
|
|
37315
37337
|
})) : (/*#__PURE__*/React__default.createElement(TypingIndicatorCont, null, /*#__PURE__*/React__default.createElement(TypingFrom, {
|
|
37316
37338
|
color: textSecondary
|
|
37317
|
-
}, formatTypingIndicatorText(
|
|
37339
|
+
}, formatTypingIndicatorText(typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items, 3)), typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping ? (/*#__PURE__*/React__default.createElement(TypingAnimation, {
|
|
37318
37340
|
borderColor: iconInactive
|
|
37319
37341
|
}, /*#__PURE__*/React__default.createElement(DotOne, null), /*#__PURE__*/React__default.createElement(DotTwo, null), /*#__PURE__*/React__default.createElement(DotThree, null))) : (/*#__PURE__*/React__default.createElement(RecordingAnimation, {
|
|
37320
37342
|
borderColor: iconInactive
|
|
@@ -39084,7 +39106,7 @@ var Files = function Files(_ref) {
|
|
|
39084
39106
|
text: '',
|
|
39085
39107
|
styles: {
|
|
39086
39108
|
background: {
|
|
39087
|
-
fill: overlayBackground2 + "
|
|
39109
|
+
fill: overlayBackground2 + "66"
|
|
39088
39110
|
},
|
|
39089
39111
|
path: {
|
|
39090
39112
|
stroke: accentColor,
|