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.modern.js
CHANGED
|
@@ -2833,181 +2833,205 @@ function _catch(body, recover) {
|
|
|
2833
2833
|
return result;
|
|
2834
2834
|
}
|
|
2835
2835
|
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2836
|
+
// Asynchronously await a promise and pass the result to a finally continuation
|
|
2837
|
+
function _finallyRethrows(body, finalizer) {
|
|
2838
|
+
try {
|
|
2839
|
+
var result = body();
|
|
2840
|
+
} catch (e) {
|
|
2841
|
+
return finalizer(true, e);
|
|
2842
|
+
}
|
|
2843
|
+
if (result && result.then) {
|
|
2844
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
2845
|
+
}
|
|
2846
|
+
return finalizer(false, result);
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
var openDatabase = function openDatabase(dbName) {
|
|
2850
|
+
return new Promise(function (resolve, reject) {
|
|
2851
|
+
var request = indexedDB.open(dbName);
|
|
2852
|
+
request.onsuccess = function () {
|
|
2853
|
+
return resolve(request.result);
|
|
2846
2854
|
};
|
|
2847
|
-
|
|
2848
|
-
|
|
2855
|
+
request.onerror = function () {
|
|
2856
|
+
return reject(request.error);
|
|
2849
2857
|
};
|
|
2850
|
-
|
|
2851
|
-
|
|
2858
|
+
});
|
|
2859
|
+
};
|
|
2860
|
+
var runUpgrade = function runUpgrade(dbName, onUpgrade) {
|
|
2861
|
+
try {
|
|
2862
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2863
|
+
var nextVersion = db.version + 1;
|
|
2864
|
+
db.close();
|
|
2865
|
+
return new Promise(function (resolve, reject) {
|
|
2866
|
+
var request = indexedDB.open(dbName, nextVersion);
|
|
2867
|
+
request.onupgradeneeded = function () {
|
|
2868
|
+
var upgradeDb = request.result;
|
|
2869
|
+
onUpgrade(upgradeDb);
|
|
2870
|
+
};
|
|
2871
|
+
request.onsuccess = function () {
|
|
2872
|
+
return resolve(request.result);
|
|
2873
|
+
};
|
|
2874
|
+
request.onerror = function () {
|
|
2875
|
+
return reject(request.error);
|
|
2876
|
+
};
|
|
2877
|
+
request.onblocked = function () {
|
|
2878
|
+
log.warn('IndexedDB upgrade blocked; close other tabs to proceed');
|
|
2879
|
+
};
|
|
2880
|
+
});
|
|
2881
|
+
});
|
|
2882
|
+
} catch (e) {
|
|
2883
|
+
return Promise.reject(e);
|
|
2884
|
+
}
|
|
2885
|
+
};
|
|
2886
|
+
var ensureStore = function ensureStore(dbName, storeName, keyPath) {
|
|
2887
|
+
try {
|
|
2888
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2852
2889
|
if (db.objectStoreNames.contains(storeName)) {
|
|
2853
|
-
|
|
2854
|
-
} else {
|
|
2855
|
-
db.close();
|
|
2856
|
-
currentVersion++;
|
|
2857
|
-
_setDataToDB(dbName, storeName, data, keyPath);
|
|
2890
|
+
return db;
|
|
2858
2891
|
}
|
|
2859
|
-
db.
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2892
|
+
db.close();
|
|
2893
|
+
return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
|
|
2894
|
+
if (!upgradeDb.objectStoreNames.contains(storeName)) {
|
|
2895
|
+
upgradeDb.createObjectStore(storeName, {
|
|
2896
|
+
keyPath: keyPath
|
|
2897
|
+
});
|
|
2898
|
+
}
|
|
2899
|
+
}));
|
|
2900
|
+
});
|
|
2901
|
+
} catch (e) {
|
|
2902
|
+
return Promise.reject(e);
|
|
2864
2903
|
}
|
|
2865
2904
|
};
|
|
2866
|
-
var
|
|
2905
|
+
var awaitTransaction = function awaitTransaction(tx) {
|
|
2867
2906
|
return new Promise(function (resolve, reject) {
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
var db = event.target.result;
|
|
2871
|
-
var transaction = event.target.transaction;
|
|
2872
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2873
|
-
var objectStore = transaction.objectStore(storeName);
|
|
2874
|
-
var request = objectStore.get(keyPath);
|
|
2875
|
-
request.onsuccess = function (event) {
|
|
2876
|
-
var result = event.target.result;
|
|
2877
|
-
resolve(result || '');
|
|
2878
|
-
};
|
|
2879
|
-
request.onerror = function (event) {
|
|
2880
|
-
log.error('Error retrieving data during upgrade: ', event.target.error);
|
|
2881
|
-
resolve('');
|
|
2882
|
-
};
|
|
2883
|
-
} else {
|
|
2884
|
-
db.createObjectStore(storeName, {
|
|
2885
|
-
keyPath: keyPatName
|
|
2886
|
-
});
|
|
2887
|
-
resolve('');
|
|
2888
|
-
}
|
|
2907
|
+
tx.oncomplete = function () {
|
|
2908
|
+
return resolve();
|
|
2889
2909
|
};
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
currentVersion++;
|
|
2893
|
-
resolve(_getDataFromDB(dbName, storeName, keyPath));
|
|
2894
|
-
} else {
|
|
2895
|
-
reject(event);
|
|
2896
|
-
}
|
|
2910
|
+
tx.onerror = function () {
|
|
2911
|
+
return reject(tx.error);
|
|
2897
2912
|
};
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2901
|
-
var transaction = db.transaction(storeName, 'readonly');
|
|
2902
|
-
var objectStore = transaction.objectStore(storeName);
|
|
2903
|
-
var request = objectStore.get(keyPath);
|
|
2904
|
-
request.onsuccess = function (event) {
|
|
2905
|
-
var result = event.target.result;
|
|
2906
|
-
if (result) {
|
|
2907
|
-
db.close();
|
|
2908
|
-
resolve(result);
|
|
2909
|
-
} else {
|
|
2910
|
-
log.info('No data found for the specified keyPathValue.');
|
|
2911
|
-
db.close();
|
|
2912
|
-
resolve('');
|
|
2913
|
-
}
|
|
2914
|
-
};
|
|
2915
|
-
request.onerror = function (event) {
|
|
2916
|
-
db.close();
|
|
2917
|
-
log.error('Error retrieving data: ', event.target.error);
|
|
2918
|
-
};
|
|
2919
|
-
} else {
|
|
2920
|
-
db.close();
|
|
2921
|
-
resolve('');
|
|
2922
|
-
}
|
|
2913
|
+
tx.onabort = function () {
|
|
2914
|
+
return reject(tx.error);
|
|
2923
2915
|
};
|
|
2924
2916
|
});
|
|
2925
2917
|
};
|
|
2926
|
-
var
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
if (
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2918
|
+
var putWithPossibleOutOfLineKey = function putWithPossibleOutOfLineKey(store, value, keyField) {
|
|
2919
|
+
try {
|
|
2920
|
+
if (store.keyPath !== null) {
|
|
2921
|
+
store.put(value);
|
|
2922
|
+
return;
|
|
2923
|
+
}
|
|
2924
|
+
} catch (e) {}
|
|
2925
|
+
var explicitKey = value === null || value === void 0 ? void 0 : value[keyField];
|
|
2926
|
+
if (explicitKey === undefined || explicitKey === null) {
|
|
2927
|
+
throw new Error("IndexedDB put requires explicit key but value has no '" + keyField + "' field");
|
|
2928
|
+
}
|
|
2929
|
+
store.put(value, explicitKey);
|
|
2930
|
+
};
|
|
2931
|
+
var setDataToDB = function setDataToDB(dbName, storeName, data, keyPath) {
|
|
2932
|
+
try {
|
|
2933
|
+
if (!('indexedDB' in window)) {
|
|
2934
|
+
log.info("This browser doesn't support IndexedDB");
|
|
2935
|
+
return Promise.resolve();
|
|
2936
|
+
}
|
|
2937
|
+
return Promise.resolve(ensureStore(dbName, storeName, keyPath)).then(function (db) {
|
|
2938
|
+
var _temp = _finallyRethrows(function () {
|
|
2939
|
+
var tx = db.transaction(storeName, 'readwrite');
|
|
2940
|
+
var store = tx.objectStore(storeName);
|
|
2941
|
+
data.forEach(function (value) {
|
|
2942
|
+
putWithPossibleOutOfLineKey(store, value, keyPath);
|
|
2943
|
+
});
|
|
2944
|
+
return Promise.resolve(awaitTransaction(tx)).then(function () {});
|
|
2945
|
+
}, function (_wasThrown, _result) {
|
|
2946
|
+
db.close();
|
|
2947
|
+
if (_wasThrown) throw _result;
|
|
2948
|
+
return _result;
|
|
2951
2949
|
});
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2950
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
2951
|
+
});
|
|
2952
|
+
} catch (e) {
|
|
2953
|
+
return Promise.reject(e);
|
|
2954
|
+
}
|
|
2955
|
+
};
|
|
2956
|
+
var getDataFromDB = function getDataFromDB(dbName, storeName, keyPathValue, keyPathName) {
|
|
2957
|
+
try {
|
|
2958
|
+
return Promise.resolve(_catch(function () {
|
|
2959
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2960
|
+
var _exit = false;
|
|
2961
|
+
function _temp5(_result2) {
|
|
2962
|
+
if (_exit) return _result2;
|
|
2963
|
+
var tx = db.transaction(storeName, 'readonly');
|
|
2964
|
+
var objectStore = tx.objectStore(storeName);
|
|
2965
|
+
return Promise.resolve(new Promise(function (resolve, reject) {
|
|
2966
|
+
var request = objectStore.get(keyPathValue);
|
|
2967
|
+
request.onsuccess = function () {
|
|
2968
|
+
return resolve(request.result);
|
|
2969
|
+
};
|
|
2970
|
+
request.onerror = function () {
|
|
2971
|
+
return reject(request.error);
|
|
2972
|
+
};
|
|
2973
|
+
})).then(function (result) {
|
|
2974
|
+
db.close();
|
|
2975
|
+
return result || '';
|
|
2976
|
+
});
|
|
2977
|
+
}
|
|
2978
|
+
var _temp4 = function () {
|
|
2979
|
+
if (!db.objectStoreNames.contains(storeName)) {
|
|
2980
|
+
var _temp3 = function _temp3() {
|
|
2981
|
+
_exit = true;
|
|
2982
|
+
return '';
|
|
2983
|
+
};
|
|
2984
|
+
db.close();
|
|
2985
|
+
var _temp2 = function () {
|
|
2986
|
+
if (keyPathName) {
|
|
2987
|
+
return Promise.resolve(ensureStore(dbName, storeName, keyPathName)).then(function (upgraded) {
|
|
2988
|
+
upgraded.close();
|
|
2989
|
+
});
|
|
2990
|
+
}
|
|
2991
|
+
}();
|
|
2992
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
2993
|
+
}
|
|
2994
|
+
}();
|
|
2995
|
+
return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
|
|
2963
2996
|
});
|
|
2964
|
-
}
|
|
2997
|
+
}, function (error) {
|
|
2998
|
+
log.error('Error retrieving data: ', error);
|
|
2999
|
+
return '';
|
|
3000
|
+
}));
|
|
3001
|
+
} catch (e) {
|
|
3002
|
+
return Promise.reject(e);
|
|
2965
3003
|
}
|
|
2966
3004
|
};
|
|
2967
3005
|
var getAllStoreNames = function getAllStoreNames(dbName) {
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
openRequest.onupgradeneeded = function (event) {
|
|
2971
|
-
var db = event.target.result;
|
|
2972
|
-
resolve(Array.from(db.objectStoreNames));
|
|
2973
|
-
};
|
|
2974
|
-
openRequest.onerror = function () {
|
|
2975
|
-
log.error('Indexeddb Error ', openRequest.error);
|
|
2976
|
-
reject(openRequest.error);
|
|
2977
|
-
};
|
|
2978
|
-
openRequest.onsuccess = function (event) {
|
|
2979
|
-
var db = event.target.result;
|
|
3006
|
+
try {
|
|
3007
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2980
3008
|
try {
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
resolve(storeNames);
|
|
2984
|
-
} catch (error) {
|
|
3009
|
+
return Array.from(db.objectStoreNames);
|
|
3010
|
+
} finally {
|
|
2985
3011
|
db.close();
|
|
2986
|
-
reject(error);
|
|
2987
3012
|
}
|
|
2988
|
-
};
|
|
2989
|
-
})
|
|
3013
|
+
});
|
|
3014
|
+
} catch (e) {
|
|
3015
|
+
return Promise.reject(e);
|
|
3016
|
+
}
|
|
2990
3017
|
};
|
|
2991
3018
|
var deleteStore = function deleteStore(dbName, storeName) {
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
var db = event.target.result;
|
|
2996
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2997
|
-
db.deleteObjectStore(storeName);
|
|
2998
|
-
currentVersion++;
|
|
2999
|
-
}
|
|
3000
|
-
};
|
|
3001
|
-
openRequest.onerror = function () {
|
|
3002
|
-
log.error('Indexeddb Error ', openRequest.error);
|
|
3003
|
-
reject(openRequest.error);
|
|
3004
|
-
};
|
|
3005
|
-
openRequest.onsuccess = function (event) {
|
|
3006
|
-
var db = event.target.result;
|
|
3019
|
+
try {
|
|
3020
|
+
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
3021
|
+
var shouldDelete = db.objectStoreNames.contains(storeName);
|
|
3007
3022
|
db.close();
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3023
|
+
if (!shouldDelete) return;
|
|
3024
|
+
return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
|
|
3025
|
+
if (upgradeDb.objectStoreNames.contains(storeName)) {
|
|
3026
|
+
upgradeDb.deleteObjectStore(storeName);
|
|
3027
|
+
}
|
|
3028
|
+
})).then(function (upgraded) {
|
|
3029
|
+
upgraded.close();
|
|
3030
|
+
});
|
|
3031
|
+
});
|
|
3032
|
+
} catch (e) {
|
|
3033
|
+
return Promise.reject(e);
|
|
3034
|
+
}
|
|
3011
3035
|
};
|
|
3012
3036
|
|
|
3013
3037
|
var METADATA_DB_NAME = 'sceyt-metadata-db';
|
|
@@ -3030,7 +3054,7 @@ var storeMetadata = function storeMetadata(url, metadata) {
|
|
|
3030
3054
|
expiresAt: Date.now() + CACHE_DURATION
|
|
3031
3055
|
});
|
|
3032
3056
|
var _temp = _catch(function () {
|
|
3033
|
-
return Promise.resolve(
|
|
3057
|
+
return Promise.resolve(setDataToDB(METADATA_DB_NAME, currentMonth, [metadataRecord], 'url')).then(function () {});
|
|
3034
3058
|
}, function (error) {
|
|
3035
3059
|
console.error('Failed to store metadata in IndexedDB:', error);
|
|
3036
3060
|
});
|
|
@@ -3078,7 +3102,7 @@ var cleanupOldMonthsMetadata = function cleanupOldMonthsMetadata() {
|
|
|
3078
3102
|
var getMetadata = function getMetadata(url) {
|
|
3079
3103
|
return Promise.resolve(_catch(function () {
|
|
3080
3104
|
var currentMonth = getCurrentMonthKey();
|
|
3081
|
-
return Promise.resolve(
|
|
3105
|
+
return Promise.resolve(getDataFromDB(METADATA_DB_NAME, currentMonth, url, 'url')).then(function (result) {
|
|
3082
3106
|
if (!result || typeof result === 'string') {
|
|
3083
3107
|
return null;
|
|
3084
3108
|
}
|
|
@@ -10916,11 +10940,11 @@ var defaultTheme = {
|
|
|
10916
10940
|
light: '#D9D9DF',
|
|
10917
10941
|
dark: '#303032'
|
|
10918
10942
|
}, _colors[THEME_COLORS.OVERLAY_BACKGROUND] = {
|
|
10919
|
-
light: '
|
|
10920
|
-
dark: '
|
|
10943
|
+
light: '#111539',
|
|
10944
|
+
dark: '#111539'
|
|
10921
10945
|
}, _colors[THEME_COLORS.OVERLAY_BACKGROUND_2] = {
|
|
10922
|
-
light: '
|
|
10923
|
-
dark: '
|
|
10946
|
+
light: '#111539',
|
|
10947
|
+
dark: '#111539'
|
|
10924
10948
|
}, _colors[THEME_COLORS.WARNING] = {
|
|
10925
10949
|
light: '#FA4C56',
|
|
10926
10950
|
dark: '#FA4C56'
|
|
@@ -11246,11 +11270,12 @@ var sendTypingAC = function sendTypingAC(state) {
|
|
|
11246
11270
|
}
|
|
11247
11271
|
};
|
|
11248
11272
|
};
|
|
11249
|
-
var sendRecordingAC = function sendRecordingAC(state) {
|
|
11273
|
+
var sendRecordingAC = function sendRecordingAC(state, channelId) {
|
|
11250
11274
|
return {
|
|
11251
11275
|
type: SEND_RECORDING,
|
|
11252
11276
|
payload: {
|
|
11253
|
-
state: state
|
|
11277
|
+
state: state,
|
|
11278
|
+
channelId: channelId
|
|
11254
11279
|
}
|
|
11255
11280
|
};
|
|
11256
11281
|
};
|
|
@@ -12876,7 +12901,7 @@ var UploadPercent = styled.span(_templateObject38 || (_templateObject38 = _tagge
|
|
|
12876
12901
|
}, function (props) {
|
|
12877
12902
|
return props.fileAttachment || props.isRepliedMessage || props.isDetailsView ? '40px' : '56px';
|
|
12878
12903
|
}, function (props) {
|
|
12879
|
-
return props.backgroundColor + "
|
|
12904
|
+
return props.backgroundColor + "66";
|
|
12880
12905
|
}, function (props) {
|
|
12881
12906
|
return props.borderRadius ? props.borderRadius : props.fileAttachment ? '8px' : props.isRepliedMessage ? '4px' : ' 50%';
|
|
12882
12907
|
}, function (props) {
|
|
@@ -16197,47 +16222,43 @@ function sendTyping(action) {
|
|
|
16197
16222
|
}, _marked22, null, [[3, 7]]);
|
|
16198
16223
|
}
|
|
16199
16224
|
function sendRecording(action) {
|
|
16200
|
-
var state,
|
|
16225
|
+
var _action$payload, state, channelId, channel, _t24;
|
|
16201
16226
|
return _regenerator().w(function (_context23) {
|
|
16202
16227
|
while (1) switch (_context23.p = _context23.n) {
|
|
16203
16228
|
case 0:
|
|
16204
|
-
|
|
16229
|
+
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
16205
16230
|
_context23.n = 1;
|
|
16206
|
-
return call(
|
|
16231
|
+
return call(getChannelFromMap, channelId);
|
|
16207
16232
|
case 1:
|
|
16208
|
-
activeChannelId = _context23.v;
|
|
16209
|
-
_context23.n = 2;
|
|
16210
|
-
return call(getChannelFromMap, activeChannelId);
|
|
16211
|
-
case 2:
|
|
16212
16233
|
channel = _context23.v;
|
|
16213
|
-
_context23.p =
|
|
16234
|
+
_context23.p = 2;
|
|
16214
16235
|
if (!channel) {
|
|
16215
|
-
_context23.n =
|
|
16236
|
+
_context23.n = 5;
|
|
16216
16237
|
break;
|
|
16217
16238
|
}
|
|
16218
16239
|
if (!state) {
|
|
16219
|
-
_context23.n =
|
|
16240
|
+
_context23.n = 4;
|
|
16220
16241
|
break;
|
|
16221
16242
|
}
|
|
16222
|
-
_context23.n =
|
|
16243
|
+
_context23.n = 3;
|
|
16223
16244
|
return call(channel.startRecording);
|
|
16224
|
-
case
|
|
16225
|
-
_context23.n =
|
|
16245
|
+
case 3:
|
|
16246
|
+
_context23.n = 5;
|
|
16226
16247
|
break;
|
|
16227
|
-
case
|
|
16228
|
-
_context23.n =
|
|
16248
|
+
case 4:
|
|
16249
|
+
_context23.n = 5;
|
|
16229
16250
|
return call(channel.stopRecording);
|
|
16230
|
-
case
|
|
16231
|
-
_context23.n =
|
|
16251
|
+
case 5:
|
|
16252
|
+
_context23.n = 7;
|
|
16232
16253
|
break;
|
|
16233
|
-
case
|
|
16234
|
-
_context23.p =
|
|
16254
|
+
case 6:
|
|
16255
|
+
_context23.p = 6;
|
|
16235
16256
|
_t24 = _context23.v;
|
|
16236
16257
|
log.error('ERROR in send recording', _t24);
|
|
16237
|
-
case
|
|
16258
|
+
case 7:
|
|
16238
16259
|
return _context23.a(2);
|
|
16239
16260
|
}
|
|
16240
|
-
}, _marked23, null, [[
|
|
16261
|
+
}, _marked23, null, [[2, 6]]);
|
|
16241
16262
|
}
|
|
16242
16263
|
function clearHistory(action) {
|
|
16243
16264
|
var payload, channelId, channel, activeChannelId, groupName, _t25;
|
|
@@ -17218,7 +17239,7 @@ function sendMessage(action) {
|
|
|
17218
17239
|
} else {
|
|
17219
17240
|
var pendingAttachment = getPendingAttachment(attachment.tid);
|
|
17220
17241
|
if (!attachment.cachedUrl) {
|
|
17221
|
-
|
|
17242
|
+
setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, updatedAttachment, {
|
|
17222
17243
|
checksum: pendingAttachment.checksum
|
|
17223
17244
|
})], 'checksum');
|
|
17224
17245
|
}
|
|
@@ -17376,7 +17397,7 @@ function sendMessage(action) {
|
|
|
17376
17397
|
});
|
|
17377
17398
|
pendingAttachment = getPendingAttachment(messageAttachment[k].tid);
|
|
17378
17399
|
if (!messageAttachment[k].cachedUrl) {
|
|
17379
|
-
|
|
17400
|
+
setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, messageResponse.attachments[k], {
|
|
17380
17401
|
checksum: pendingAttachment.checksum || (pendingAttachment === null || pendingAttachment === void 0 ? void 0 : pendingAttachment.file)
|
|
17381
17402
|
})], 'checksum');
|
|
17382
17403
|
}
|
|
@@ -20993,15 +21014,15 @@ var Channel = function Channel(_ref3) {
|
|
|
20993
21014
|
items: filteredItems,
|
|
20994
21015
|
isTyping: !!filteredItems.find(function (item) {
|
|
20995
21016
|
return item.typingState;
|
|
21017
|
+
}),
|
|
21018
|
+
isRecording: !!filteredItems.find(function (item) {
|
|
21019
|
+
return item.recordingState;
|
|
20996
21020
|
})
|
|
20997
21021
|
};
|
|
20998
21022
|
}, [typingOrRecordingIndicator]);
|
|
20999
|
-
var isTypingOrRecording = useMemo(function () {
|
|
21000
|
-
return typingOrRecording.items.length > 0;
|
|
21001
|
-
}, [typingOrRecording]);
|
|
21002
21023
|
var MessageText = useMemo(function () {
|
|
21003
21024
|
return /*#__PURE__*/React__default.createElement(ChannelMessageText, {
|
|
21004
|
-
isTypingOrRecording:
|
|
21025
|
+
isTypingOrRecording: (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording),
|
|
21005
21026
|
user: user,
|
|
21006
21027
|
contactsMap: contactsMap,
|
|
21007
21028
|
getFromContacts: getFromContacts,
|
|
@@ -21015,7 +21036,7 @@ var Channel = function Channel(_ref3) {
|
|
|
21015
21036
|
lastMessage: lastMessage,
|
|
21016
21037
|
isDirectChannel: isDirectChannel
|
|
21017
21038
|
});
|
|
21018
|
-
}, [
|
|
21039
|
+
}, [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]);
|
|
21019
21040
|
return /*#__PURE__*/React__default.createElement(Container$2, {
|
|
21020
21041
|
theme: theme,
|
|
21021
21042
|
selectedChannel: channel.id === activeChannel.id,
|
|
@@ -21058,9 +21079,9 @@ var Channel = function Channel(_ref3) {
|
|
|
21058
21079
|
unreadMentions: !!(channel.newMentionCount && channel.newMentionCount > 0),
|
|
21059
21080
|
fontSize: channelLastMessageFontSize,
|
|
21060
21081
|
height: channelLastMessageHeight
|
|
21061
|
-
},
|
|
21082
|
+
}, typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping || typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording ? !isDirectChannel ? (/*#__PURE__*/React__default.createElement(LastMessageAuthor, {
|
|
21062
21083
|
typing: typingOrRecording.isTyping,
|
|
21063
|
-
recording:
|
|
21084
|
+
recording: typingOrRecording.isRecording,
|
|
21064
21085
|
color: textPrimary
|
|
21065
21086
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
21066
21087
|
ref: messageAuthorRef
|
|
@@ -21078,11 +21099,11 @@ var Channel = function Channel(_ref3) {
|
|
|
21078
21099
|
color: textPrimary
|
|
21079
21100
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
21080
21101
|
ref: messageAuthorRef
|
|
21081
|
-
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !
|
|
21102
|
+
}, 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, {
|
|
21082
21103
|
color: draftMessageText && warningColor || textPrimary
|
|
21083
21104
|
}, ": ")), /*#__PURE__*/React__default.createElement(LastMessageText, {
|
|
21084
21105
|
color: textSecondary,
|
|
21085
|
-
withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && !
|
|
21106
|
+
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)),
|
|
21086
21107
|
noBody: lastMessage && !lastMessage.body,
|
|
21087
21108
|
deletedMessage: lastMessage && lastMessage.state === MESSAGE_STATUS.DELETE
|
|
21088
21109
|
}, MessageText)))), /*#__PURE__*/React__default.createElement(ChannelStatus, {
|
|
@@ -21598,7 +21619,7 @@ var Container$4 = styled.div(_templateObject$8 || (_templateObject$8 = _taggedTe
|
|
|
21598
21619
|
}, function (props) {
|
|
21599
21620
|
return props.height ? props.height + "px" : '0px';
|
|
21600
21621
|
}, function (props) {
|
|
21601
|
-
return props.background + "
|
|
21622
|
+
return props.background + "66";
|
|
21602
21623
|
});
|
|
21603
21624
|
|
|
21604
21625
|
var _templateObject$9, _templateObject2$8, _templateObject3$5, _templateObject4$5, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject0$2, _templateObject1$2;
|
|
@@ -24042,7 +24063,7 @@ var Container$a = styled.div(_templateObject$j || (_templateObject$j = _taggedTe
|
|
|
24042
24063
|
}, function (props) {
|
|
24043
24064
|
return props.dateDividerTextColor;
|
|
24044
24065
|
}, function (props) {
|
|
24045
|
-
return props.dateDividerBackgroundColor + "
|
|
24066
|
+
return props.dateDividerBackgroundColor + "66";
|
|
24046
24067
|
}, function (props) {
|
|
24047
24068
|
return props.dateDividerBorderRadius || '14px';
|
|
24048
24069
|
}, function (props) {
|
|
@@ -25572,7 +25593,7 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
25572
25593
|
text: '',
|
|
25573
25594
|
styles: {
|
|
25574
25595
|
background: {
|
|
25575
|
-
fill: overlayBackground2 + "
|
|
25596
|
+
fill: overlayBackground2 + "66"
|
|
25576
25597
|
},
|
|
25577
25598
|
path: {
|
|
25578
25599
|
stroke: textOnPrimary,
|
|
@@ -25827,7 +25848,7 @@ var Container$c = styled.div(_templateObject$p || (_templateObject$p = _taggedTe
|
|
|
25827
25848
|
}, function (props) {
|
|
25828
25849
|
return props.textColor;
|
|
25829
25850
|
}, function (props) {
|
|
25830
|
-
return props.backgroundColor + "
|
|
25851
|
+
return props.backgroundColor + "66";
|
|
25831
25852
|
}, function (props) {
|
|
25832
25853
|
return props.border;
|
|
25833
25854
|
}, function (props) {
|
|
@@ -26875,7 +26896,7 @@ var VideoTime = styled.div(_templateObject2$o || (_templateObject2$o = _taggedTe
|
|
|
26875
26896
|
}, function (props) {
|
|
26876
26897
|
return props.isRepliedMessage ? '0 3px' : '4px 6px';
|
|
26877
26898
|
}, function (props) {
|
|
26878
|
-
return props.messageTimeBackgroundColor + "
|
|
26899
|
+
return props.messageTimeBackgroundColor + "66";
|
|
26879
26900
|
}, function (props) {
|
|
26880
26901
|
return props.color;
|
|
26881
26902
|
}, function (props) {
|
|
@@ -29489,7 +29510,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29489
29510
|
text: '',
|
|
29490
29511
|
styles: {
|
|
29491
29512
|
background: {
|
|
29492
|
-
fill: overlayBackground2 + "
|
|
29513
|
+
fill: overlayBackground2 + "66"
|
|
29493
29514
|
},
|
|
29494
29515
|
path: {
|
|
29495
29516
|
stroke: textOnPrimary,
|
|
@@ -29539,7 +29560,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29539
29560
|
text: '',
|
|
29540
29561
|
styles: {
|
|
29541
29562
|
background: {
|
|
29542
|
-
fill: overlayBackground2 + "
|
|
29563
|
+
fill: overlayBackground2 + "66"
|
|
29543
29564
|
},
|
|
29544
29565
|
path: {
|
|
29545
29566
|
stroke: textOnPrimary,
|
|
@@ -29646,7 +29667,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29646
29667
|
text: '',
|
|
29647
29668
|
styles: {
|
|
29648
29669
|
background: {
|
|
29649
|
-
fill: overlayBackground2 + "
|
|
29670
|
+
fill: overlayBackground2 + "66"
|
|
29650
29671
|
},
|
|
29651
29672
|
path: {
|
|
29652
29673
|
stroke: textOnPrimary,
|
|
@@ -30818,7 +30839,7 @@ var MessageStatusAndTime = function MessageStatusAndTime(_ref) {
|
|
|
30818
30839
|
}))));
|
|
30819
30840
|
};
|
|
30820
30841
|
var MessageStatusAndTime$1 = /*#__PURE__*/React__default.memo(MessageStatusAndTime, function (prevProps, nextProps) {
|
|
30821
|
-
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;
|
|
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 && prevProps.withAttachment === nextProps.withAttachment;
|
|
30822
30843
|
});
|
|
30823
30844
|
var MessageStatus = styled.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) {
|
|
30824
30845
|
return props.height || '14px';
|
|
@@ -30837,7 +30858,7 @@ var MessageStatusAndTimeContainer = styled.span(_templateObject3$o || (_template
|
|
|
30837
30858
|
}, function (props) {
|
|
30838
30859
|
return props.withAttachment && '4px 6px';
|
|
30839
30860
|
}, function (props) {
|
|
30840
|
-
return props.withAttachment && !props.fileAttachment && props.messageTimeBackgroundColor + "
|
|
30861
|
+
return props.withAttachment && !props.fileAttachment && props.messageTimeBackgroundColor + "66";
|
|
30841
30862
|
}, function (props) {
|
|
30842
30863
|
return props.lineHeight || '14px';
|
|
30843
30864
|
}, function (props) {
|
|
@@ -30893,7 +30914,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
30893
30914
|
var queryBuilder = new client.MessageLinkOGQueryBuilder(url);
|
|
30894
30915
|
return Promise.resolve(queryBuilder.build()).then(function (query) {
|
|
30895
30916
|
return Promise.resolve(query.loadOGData()).then(function (metadata) {
|
|
30896
|
-
return Promise.resolve(storeMetadata(url.replace('https://', ''), metadata)).then(function () {
|
|
30917
|
+
return Promise.resolve(storeMetadata(url.replace('https://', '').replace('http://', ''), metadata)).then(function () {
|
|
30897
30918
|
setMetadata(metadata);
|
|
30898
30919
|
});
|
|
30899
30920
|
});
|
|
@@ -30915,7 +30936,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
30915
30936
|
if (attachment !== null && attachment !== void 0 && attachment.id && !metadata) {
|
|
30916
30937
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
30917
30938
|
if (url) {
|
|
30918
|
-
getMetadata(url.replace('https://', '')).then(function (cachedMetadata) {
|
|
30939
|
+
getMetadata(url.replace('https://', '').replace('http://', '')).then(function (cachedMetadata) {
|
|
30919
30940
|
try {
|
|
30920
30941
|
if (cachedMetadata) {
|
|
30921
30942
|
setMetadata(cachedMetadata);
|
|
@@ -33316,7 +33337,7 @@ var MessageTopDate = styled.div(_templateObject4$o || (_templateObject4$o = _tag
|
|
|
33316
33337
|
}, function (props) {
|
|
33317
33338
|
return props.dateDividerTextColor;
|
|
33318
33339
|
}, function (props) {
|
|
33319
|
-
return props.dateDividerBackgroundColor + "
|
|
33340
|
+
return props.dateDividerBackgroundColor + "66";
|
|
33320
33341
|
}, function (props) {
|
|
33321
33342
|
return props.dateDividerBorder;
|
|
33322
33343
|
}, function (props) {
|
|
@@ -35360,19 +35381,19 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35360
35381
|
}, [currentRecordedFile]);
|
|
35361
35382
|
var dispatch = useDispatch();
|
|
35362
35383
|
var handleStartRecording = function handleStartRecording() {
|
|
35363
|
-
dispatch(sendRecordingAC(true));
|
|
35384
|
+
dispatch(sendRecordingAC(true, currentChannelId));
|
|
35364
35385
|
if (sendingInterval) {
|
|
35365
35386
|
clearInterval(sendingInterval);
|
|
35366
35387
|
setSendingInterval(null);
|
|
35367
35388
|
return;
|
|
35368
35389
|
}
|
|
35369
35390
|
var interval = setInterval(function () {
|
|
35370
|
-
dispatch(sendRecordingAC(true));
|
|
35391
|
+
dispatch(sendRecordingAC(true, currentChannelId));
|
|
35371
35392
|
}, 1000);
|
|
35372
35393
|
setSendingInterval(interval);
|
|
35373
35394
|
};
|
|
35374
35395
|
var handleStopRecording = function handleStopRecording() {
|
|
35375
|
-
dispatch(sendRecordingAC(false));
|
|
35396
|
+
dispatch(sendRecordingAC(false, currentChannelId));
|
|
35376
35397
|
if (sendingInterval) {
|
|
35377
35398
|
clearInterval(sendingInterval);
|
|
35378
35399
|
setSendingInterval(null);
|
|
@@ -35526,10 +35547,9 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35526
35547
|
return Promise.resolve(_catch(function () {
|
|
35527
35548
|
var _wavesurfer$current3;
|
|
35528
35549
|
function _temp3(_result3) {
|
|
35550
|
+
var _wavesurfer$current$i, _wavesurfer$current$i2;
|
|
35529
35551
|
if (_exit) return _result3;
|
|
35530
|
-
|
|
35531
|
-
return;
|
|
35532
|
-
}
|
|
35552
|
+
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);
|
|
35533
35553
|
wavesurfer.current[id].on('ready', function () {
|
|
35534
35554
|
setRecordingIsReadyToPlay(true);
|
|
35535
35555
|
var audioDuration = wavesurfer.current[id].getDuration();
|
|
@@ -35641,7 +35661,6 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35641
35661
|
recorder.stop().getMp3().then(function (_ref4) {
|
|
35642
35662
|
var buffer = _ref4[0],
|
|
35643
35663
|
blob = _ref4[1];
|
|
35644
|
-
setCurrentTime(0);
|
|
35645
35664
|
var file = new File(buffer, 'record.mp3', {
|
|
35646
35665
|
type: blob.type,
|
|
35647
35666
|
lastModified: Date.now()
|
|
@@ -35707,15 +35726,12 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35707
35726
|
if ((_wavesurfer$current5 = wavesurfer.current) !== null && _wavesurfer$current5 !== void 0 && _wavesurfer$current5[cId || currentChannelId]) {
|
|
35708
35727
|
if (!wavesurfer.current[cId || currentChannelId].isPlaying()) {
|
|
35709
35728
|
setPlayAudio(true);
|
|
35710
|
-
handleStartRecording();
|
|
35711
35729
|
intervalRef.current[cId || currentChannelId] = setInterval(function () {
|
|
35712
35730
|
var currentTime = wavesurfer.current[cId || currentChannelId].getCurrentTime();
|
|
35713
35731
|
if (currentTime >= 0) {
|
|
35714
35732
|
setCurrentTime(currentTime);
|
|
35715
35733
|
}
|
|
35716
35734
|
}, 10);
|
|
35717
|
-
} else {
|
|
35718
|
-
handleStopRecording();
|
|
35719
35735
|
}
|
|
35720
35736
|
wavesurfer.current[cId || currentChannelId].playPause();
|
|
35721
35737
|
}
|
|
@@ -35831,6 +35847,7 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
35831
35847
|
setRecordedFile(audioRecording || null);
|
|
35832
35848
|
setRecordingIsReadyToPlay(!!audioRecording);
|
|
35833
35849
|
}
|
|
35850
|
+
handleStopRecording();
|
|
35834
35851
|
setCurrentChannelId(channelId);
|
|
35835
35852
|
}, [channelId]);
|
|
35836
35853
|
return /*#__PURE__*/React__default.createElement(Container$j, {
|
|
@@ -36854,7 +36871,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36854
36871
|
}
|
|
36855
36872
|
var dataFromDb;
|
|
36856
36873
|
var _temp11 = _catch(function () {
|
|
36857
|
-
return Promise.resolve(
|
|
36874
|
+
return Promise.resolve(getDataFromDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, checksumHash, 'checksum')).then(function (_getDataFromDB) {
|
|
36858
36875
|
dataFromDb = _getDataFromDB;
|
|
36859
36876
|
});
|
|
36860
36877
|
}, function (e) {
|
|
@@ -37194,16 +37211,21 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37194
37211
|
}
|
|
37195
37212
|
};
|
|
37196
37213
|
}, []);
|
|
37197
|
-
var
|
|
37198
|
-
|
|
37214
|
+
var typingOrRecording = useMemo(function () {
|
|
37215
|
+
var dataValues = typingOrRecordingIndicator ? Object.values(typingOrRecordingIndicator) : [];
|
|
37216
|
+
var filteredItems = dataValues.filter(function (item) {
|
|
37199
37217
|
return item.typingState || item.recordingState;
|
|
37200
|
-
}) : [];
|
|
37201
|
-
}, [typingOrRecordingIndicator]);
|
|
37202
|
-
var isTyping = useMemo(function () {
|
|
37203
|
-
return !!filteredTypingOrRecordingIndicator.find(function (item) {
|
|
37204
|
-
return item.typingState;
|
|
37205
37218
|
});
|
|
37206
|
-
|
|
37219
|
+
return {
|
|
37220
|
+
items: filteredItems,
|
|
37221
|
+
isTyping: !!filteredItems.find(function (item) {
|
|
37222
|
+
return item.typingState;
|
|
37223
|
+
}),
|
|
37224
|
+
isRecording: !!filteredItems.find(function (item) {
|
|
37225
|
+
return item.recordingState;
|
|
37226
|
+
})
|
|
37227
|
+
};
|
|
37228
|
+
}, [typingOrRecordingIndicator]);
|
|
37207
37229
|
var formatTypingIndicatorText = function formatTypingIndicatorText(users, maxShownUsers) {
|
|
37208
37230
|
if (maxShownUsers === void 0) {
|
|
37209
37231
|
maxShownUsers = 3;
|
|
@@ -37212,7 +37234,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37212
37234
|
if (users.length === 1) {
|
|
37213
37235
|
var _user = users[0];
|
|
37214
37236
|
var userName = makeUsername(getFromContacts && _user.from && contactsMap[_user.from.id], _user.from, getFromContacts);
|
|
37215
|
-
return "" + userName + (isTyping ? activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is typing' : '' : activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is recording' : '');
|
|
37237
|
+
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' : '');
|
|
37216
37238
|
}
|
|
37217
37239
|
if (users.length <= maxShownUsers) {
|
|
37218
37240
|
var userNames = users.map(function (user) {
|
|
@@ -37282,8 +37304,8 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37282
37304
|
}, "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, {
|
|
37283
37305
|
color: textPrimary,
|
|
37284
37306
|
iconColor: accentColor
|
|
37285
|
-
}, /*#__PURE__*/React__default.createElement(SvgEye, null), " Read only")) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TypingIndicator$1, null,
|
|
37286
|
-
from:
|
|
37307
|
+
}, /*#__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, {
|
|
37308
|
+
from: typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items.map(function (item) {
|
|
37287
37309
|
return {
|
|
37288
37310
|
id: item.from.id,
|
|
37289
37311
|
name: item.from.name,
|
|
@@ -37293,7 +37315,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37293
37315
|
})
|
|
37294
37316
|
})) : (/*#__PURE__*/React__default.createElement(TypingIndicatorCont, null, /*#__PURE__*/React__default.createElement(TypingFrom, {
|
|
37295
37317
|
color: textSecondary
|
|
37296
|
-
}, formatTypingIndicatorText(
|
|
37318
|
+
}, formatTypingIndicatorText(typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items, 3)), typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping ? (/*#__PURE__*/React__default.createElement(TypingAnimation, {
|
|
37297
37319
|
borderColor: iconInactive
|
|
37298
37320
|
}, /*#__PURE__*/React__default.createElement(DotOne, null), /*#__PURE__*/React__default.createElement(DotTwo, null), /*#__PURE__*/React__default.createElement(DotThree, null))) : (/*#__PURE__*/React__default.createElement(RecordingAnimation, {
|
|
37299
37321
|
borderColor: iconInactive
|
|
@@ -39063,7 +39085,7 @@ var Files = function Files(_ref) {
|
|
|
39063
39085
|
text: '',
|
|
39064
39086
|
styles: {
|
|
39065
39087
|
background: {
|
|
39066
|
-
fill: overlayBackground2 + "
|
|
39088
|
+
fill: overlayBackground2 + "66"
|
|
39067
39089
|
},
|
|
39068
39090
|
path: {
|
|
39069
39091
|
stroke: accentColor,
|