mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
bump react to 17
This commit is contained in:
parent
cb5a22f3aa
commit
bea704ecf0
20 changed files with 110 additions and 98 deletions
|
@ -98,9 +98,9 @@
|
|||
"pify": "3.0.0",
|
||||
"protobufjs": "^6.9.0",
|
||||
"rc-slider": "^8.7.1",
|
||||
"react": "^16.13.1",
|
||||
"react": "^17.0.2",
|
||||
"react-contexify": "5.0.0",
|
||||
"react-dom": "16.8.3",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-emoji": "^0.5.0",
|
||||
"react-emoji-render": "^1.2.4",
|
||||
"react-h5-audio-player": "^3.2.0",
|
||||
|
@ -112,7 +112,6 @@
|
|||
"react-toastify": "^6.0.9",
|
||||
"react-use": "^17.2.1",
|
||||
"react-virtualized": "9.22.3",
|
||||
"react-window-infinite-loader": "^1.0.7",
|
||||
"read-last-lines": "1.3.0",
|
||||
"redux": "4.0.1",
|
||||
"redux-logger": "3.0.6",
|
||||
|
@ -158,8 +157,8 @@
|
|||
"@types/pify": "3.0.2",
|
||||
"@types/qs": "6.5.1",
|
||||
"@types/rc-slider": "^8.6.5",
|
||||
"@types/react": "16.8.5",
|
||||
"@types/react-dom": "16.8.2",
|
||||
"@types/react": "^17.0.15",
|
||||
"@types/react-dom": "^17.0.2",
|
||||
"@types/react-mentions": "^4.1.1",
|
||||
"@types/react-mic": "^12.4.1",
|
||||
"@types/react-portal": "^4.0.2",
|
||||
|
|
|
@ -187,7 +187,7 @@ const Icon = ({
|
|||
}) => (
|
||||
<div
|
||||
style={{
|
||||
...styles.object,
|
||||
...(styles.object as any),
|
||||
...colorSVG(url, Colors.ICON_SECONDARY),
|
||||
maxWidth: 200,
|
||||
}}
|
||||
|
@ -245,7 +245,9 @@ export const LightboxObject = ({
|
|||
});
|
||||
|
||||
if (isImageTypeSupported) {
|
||||
return <img style={styles.object} alt={window.i18n('lightboxImageAlt')} src={urlToLoad} />;
|
||||
return (
|
||||
<img style={styles.object as any} alt={window.i18n('lightboxImageAlt')} src={urlToLoad} />
|
||||
);
|
||||
}
|
||||
|
||||
const isVideoTypeSupported = GoogleChrome.isVideoTypeSupported(contentType);
|
||||
|
@ -259,7 +261,7 @@ export const LightboxObject = ({
|
|||
ref={videoRef}
|
||||
onClick={playVideo}
|
||||
controls={true}
|
||||
style={styles.object}
|
||||
style={styles.object as any}
|
||||
key={urlToLoad}
|
||||
>
|
||||
<source src={urlToLoad} />
|
||||
|
@ -302,8 +304,8 @@ export const Lightbox = (props: Props) => {
|
|||
};
|
||||
|
||||
return (
|
||||
<div style={styles.container} role="dialog">
|
||||
<div style={styles.mainContainer}>
|
||||
<div style={styles.container as any} role="dialog">
|
||||
<div style={styles.mainContainer as any}>
|
||||
<div style={styles.controlsOffsetPlaceholder} />
|
||||
<div
|
||||
style={styles.objectParentContainer}
|
||||
|
@ -311,7 +313,7 @@ export const Lightbox = (props: Props) => {
|
|||
ref={containerRef}
|
||||
role="button"
|
||||
>
|
||||
<div style={styles.objectContainer}>
|
||||
<div style={styles.objectContainer as any}>
|
||||
{!is.undefined(contentType) ? (
|
||||
<LightboxObject
|
||||
objectURL={objectURL}
|
||||
|
@ -320,10 +322,10 @@ export const Lightbox = (props: Props) => {
|
|||
onObjectClick={onObjectClick}
|
||||
/>
|
||||
) : null}
|
||||
{caption ? <div style={styles.caption}>{caption}</div> : null}
|
||||
{caption ? <div style={styles.caption as any}>{caption}</div> : null}
|
||||
</div>
|
||||
</div>
|
||||
<div style={styles.controls}>
|
||||
<div style={styles.controls as any}>
|
||||
<Flex flex="1 1 auto">
|
||||
<IconButton
|
||||
type="close"
|
||||
|
@ -339,7 +341,7 @@ export const Lightbox = (props: Props) => {
|
|||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
<div style={styles.navigationContainer}>
|
||||
<div style={styles.navigationContainer as any}>
|
||||
{onPrevious ? (
|
||||
<IconButton type="previous" onClick={onPrevious} theme={theme} />
|
||||
) : (
|
||||
|
|
|
@ -34,7 +34,7 @@ export const ContactName = (props: Props) => {
|
|||
: {}) as React.CSSProperties;
|
||||
const textProfile = profileName || name || window.i18n('anonymous');
|
||||
const profileElement = shouldShowProfile ? (
|
||||
<span style={styles} className={`${prefix}__profile-name`}>
|
||||
<span style={styles as any} className={`${prefix}__profile-name`}>
|
||||
<Emojify text={textProfile} />
|
||||
</span>
|
||||
) : null;
|
||||
|
|
|
@ -153,11 +153,11 @@ class MessageInner extends React.PureComponent<Props, State> {
|
|||
clearInterval(this.expirationCheckInterval);
|
||||
}
|
||||
if (this.expiredTimeout) {
|
||||
clearTimeout(this.expiredTimeout);
|
||||
global.clearTimeout(this.expiredTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps: Props) {
|
||||
public componentDidUpdate() {
|
||||
this.checkExpired();
|
||||
}
|
||||
|
||||
|
@ -726,14 +726,15 @@ class MessageInner extends React.PureComponent<Props, State> {
|
|||
|
||||
private onQuoteClick(e: any) {
|
||||
const { quote, multiSelectMode, id } = this.props;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (!quote) {
|
||||
window.log.warn('onQuoteClick: quote not valid');
|
||||
return;
|
||||
}
|
||||
const quoteId = _.toNumber(quote.messageId);
|
||||
const { authorPhoneNumber, referencedMessageNotFound } = quote;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
if (multiSelectMode && id) {
|
||||
window.inboxStore?.dispatch(toggleSelectedMessageId(id));
|
||||
|
||||
|
@ -810,7 +811,7 @@ class MessageInner extends React.PureComponent<Props, State> {
|
|||
const { timestamp, serverTimestamp, authorPhoneNumber, attachments, convoId } = this.props;
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
e.preventDefault();
|
||||
if (!attachments?.length) {
|
||||
return;
|
||||
}
|
||||
|
@ -828,6 +829,7 @@ class MessageInner extends React.PureComponent<Props, State> {
|
|||
|
||||
private onClickOnMessageOuterContainer(event: any) {
|
||||
const { multiSelectMode, id } = this.props;
|
||||
|
||||
const selection = window.getSelection();
|
||||
// Text is being selected
|
||||
if (selection && selection.type === 'Range') {
|
||||
|
@ -839,7 +841,8 @@ class MessageInner extends React.PureComponent<Props, State> {
|
|||
if ((!multiSelectMode && target.className === 'text-selectable') || window.contextMenuShown) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
if (id) {
|
||||
window.inboxStore?.dispatch(toggleSelectedMessageId(id));
|
||||
}
|
||||
|
@ -857,6 +860,8 @@ class MessageInner extends React.PureComponent<Props, State> {
|
|||
if (target.className === 'text-selectable' || window.contextMenuShown) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -249,9 +249,9 @@ export const ActionsPanel = () => {
|
|||
// wait for cleanUpMediasInterval and then start cleaning up medias
|
||||
// this would be way easier to just be able to not trigger a call with the setInterval
|
||||
useEffect(() => {
|
||||
const timeout = global.setTimeout(() => setStartCleanUpMedia(true), cleanUpMediasInterval);
|
||||
const timeout = setTimeout(() => setStartCleanUpMedia(true), cleanUpMediasInterval);
|
||||
|
||||
return () => global.clearTimeout(timeout);
|
||||
return () => clearTimeout(timeout);
|
||||
}, []);
|
||||
|
||||
useInterval(
|
||||
|
|
|
@ -62,7 +62,7 @@ class SessionMessagesListContainerInner extends React.Component<Props> {
|
|||
|
||||
public componentWillUnmount() {
|
||||
if (this.timeoutResetQuotedScroll) {
|
||||
clearTimeout(this.timeoutResetQuotedScroll);
|
||||
global.clearTimeout(this.timeoutResetQuotedScroll);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ class SessionMessagesListContainerInner extends React.Component<Props> {
|
|||
*/
|
||||
private setupTimeoutResetQuotedHighlightedMessage(messageId: string | undefined) {
|
||||
if (this.timeoutResetQuotedScroll) {
|
||||
clearTimeout(this.timeoutResetQuotedScroll);
|
||||
global.clearTimeout(this.timeoutResetQuotedScroll);
|
||||
}
|
||||
|
||||
if (messageId !== undefined) {
|
||||
|
|
|
@ -118,13 +118,13 @@ const animation = (props: {
|
|||
};
|
||||
|
||||
//tslint:disable no-unnecessary-callback-wrapper
|
||||
const Svg = styled.svg<StyledSvgProps>`
|
||||
const Svg = React.memo(styled.svg<StyledSvgProps>`
|
||||
width: ${props => props.width};
|
||||
transform: ${props => `rotate(${props.iconRotation}deg)`};
|
||||
animation: ${props => animation(props)};
|
||||
border-radius: ${props => props.borderRadius};
|
||||
filter: ${props => (props.noScale ? `drop-shadow(0px 0px 4px ${props.iconColor})` : '')};
|
||||
`;
|
||||
`);
|
||||
//tslint:enable no-unnecessary-callback-wrapper
|
||||
|
||||
const SessionSvg = (props: {
|
||||
|
|
|
@ -310,7 +310,7 @@ function _removeJob(id: number) {
|
|||
}
|
||||
|
||||
if (_jobs[id].timer) {
|
||||
clearTimeout(_jobs[id].timer);
|
||||
global.clearTimeout(_jobs[id].timer);
|
||||
_jobs[id].timer = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -361,6 +361,7 @@ export async function uploadOurAvatar(newAvatarDecrypted?: ArrayBuffer) {
|
|||
getConversationController()
|
||||
.get(UserUtils.getOurPubKeyStrFromCache())
|
||||
?.get('profileKey') || null;
|
||||
|
||||
profileKey = ourConvoProfileKey ? fromHexToArray(ourConvoProfileKey) : null;
|
||||
if (!profileKey) {
|
||||
window.log.info('our profileKey not found. Not reuploading our avatar');
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
saveMessages,
|
||||
updateConversation,
|
||||
} from '../../ts/data/data';
|
||||
import { fromArrayBufferToBase64, fromBase64ToArrayBuffer, toHex } from '../session/utils/String';
|
||||
import { toHex } from '../session/utils/String';
|
||||
import {
|
||||
actions as conversationActions,
|
||||
conversationChanged,
|
||||
|
@ -300,7 +300,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
|||
|
||||
public setTypingRefreshTimer() {
|
||||
if (this.typingRefreshTimer) {
|
||||
clearTimeout(this.typingRefreshTimer);
|
||||
global.clearTimeout(this.typingRefreshTimer);
|
||||
}
|
||||
this.typingRefreshTimer = global.setTimeout(this.onTypingRefreshTimeout.bind(this), 10 * 1000);
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
|||
|
||||
public setTypingPauseTimer() {
|
||||
if (this.typingPauseTimer) {
|
||||
clearTimeout(this.typingPauseTimer);
|
||||
global.clearTimeout(this.typingPauseTimer);
|
||||
}
|
||||
this.typingPauseTimer = global.setTimeout(this.onTypingPauseTimeout.bind(this), 10 * 1000);
|
||||
}
|
||||
|
@ -329,11 +329,11 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
|||
|
||||
public clearTypingTimers() {
|
||||
if (this.typingPauseTimer) {
|
||||
clearTimeout(this.typingPauseTimer);
|
||||
global.clearTimeout(this.typingPauseTimer);
|
||||
this.typingPauseTimer = null;
|
||||
}
|
||||
if (this.typingRefreshTimer) {
|
||||
clearTimeout(this.typingRefreshTimer);
|
||||
global.clearTimeout(this.typingRefreshTimer);
|
||||
this.typingRefreshTimer = null;
|
||||
}
|
||||
}
|
||||
|
@ -1468,7 +1468,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
|||
|
||||
const wasTyping = !!this.typingTimer;
|
||||
if (this.typingTimer) {
|
||||
clearTimeout(this.typingTimer);
|
||||
global.clearTimeout(this.typingTimer);
|
||||
this.typingTimer = null;
|
||||
}
|
||||
|
||||
|
@ -1497,7 +1497,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
|||
|
||||
public async clearContactTypingTimer(sender: string) {
|
||||
if (!!this.typingTimer) {
|
||||
clearTimeout(this.typingTimer);
|
||||
global.clearTimeout(this.typingTimer);
|
||||
this.typingTimer = null;
|
||||
|
||||
// User was previously typing, but timed out or we received message. State change!
|
||||
|
|
|
@ -98,7 +98,7 @@ export async function initiateGroupUpdate(
|
|||
name: groupName,
|
||||
members,
|
||||
// remove from the zombies list the zombies not which are not in the group anymore
|
||||
zombies: convo.get('zombies').filter(z => members.includes(z)),
|
||||
zombies: convo.get('zombies')?.filter(z => members.includes(z)),
|
||||
activeAt: Date.now(),
|
||||
expireTimer: convo.get('expireTimer'),
|
||||
avatar,
|
||||
|
@ -119,23 +119,28 @@ export async function initiateGroupUpdate(
|
|||
if (diff.newName?.length) {
|
||||
const nameOnlyDiff: GroupDiff = { newName: diff.newName };
|
||||
const dbMessageName = await addUpdateMessage(convo, nameOnlyDiff, 'outgoing', Date.now());
|
||||
getMessageController().register(dbMessageName.id, dbMessageName);
|
||||
await sendNewName(convo, diff.newName, dbMessageName.id);
|
||||
getMessageController().register(dbMessageName.id as string, dbMessageName);
|
||||
await sendNewName(convo, diff.newName, dbMessageName.id as string);
|
||||
}
|
||||
|
||||
if (diff.joiningMembers?.length) {
|
||||
const joiningOnlyDiff: GroupDiff = { joiningMembers: diff.joiningMembers };
|
||||
const dbMessageAdded = await addUpdateMessage(convo, joiningOnlyDiff, 'outgoing', Date.now());
|
||||
getMessageController().register(dbMessageAdded.id, dbMessageAdded);
|
||||
await sendAddedMembers(convo, diff.joiningMembers, dbMessageAdded.id, updateObj);
|
||||
getMessageController().register(dbMessageAdded.id as string, dbMessageAdded);
|
||||
await sendAddedMembers(convo, diff.joiningMembers, dbMessageAdded.id as string, updateObj);
|
||||
}
|
||||
|
||||
if (diff.leavingMembers?.length) {
|
||||
const leavingOnlyDiff: GroupDiff = { leavingMembers: diff.leavingMembers };
|
||||
const dbMessageLeaving = await addUpdateMessage(convo, leavingOnlyDiff, 'outgoing', Date.now());
|
||||
getMessageController().register(dbMessageLeaving.id, dbMessageLeaving);
|
||||
getMessageController().register(dbMessageLeaving.id as string, dbMessageLeaving);
|
||||
const stillMembers = members;
|
||||
await sendRemovedMembers(convo, diff.leavingMembers, stillMembers, dbMessageLeaving.id);
|
||||
await sendRemovedMembers(
|
||||
convo,
|
||||
diff.leavingMembers,
|
||||
stillMembers,
|
||||
dbMessageLeaving.id as string
|
||||
);
|
||||
}
|
||||
await convo.commit();
|
||||
}
|
||||
|
@ -165,7 +170,7 @@ export async function addUpdateMessage(
|
|||
const unread = type === 'incoming';
|
||||
|
||||
const message = await convo.addSingleMessage({
|
||||
conversationId: convo.get('id'),
|
||||
conversationId: convo.get('id') as string,
|
||||
type,
|
||||
sent_at: sentAt,
|
||||
received_at: now,
|
||||
|
@ -259,7 +264,7 @@ export async function updateOrCreateClosedGroup(details: GroupInfo) {
|
|||
|
||||
const isBlocked = details.blocked || false;
|
||||
if (conversation.isClosedGroup() || conversation.isMediumGroup()) {
|
||||
await BlockedNumberController.setGroupBlocked(conversation.id, isBlocked);
|
||||
await BlockedNumberController.setGroupBlocked(conversation.id as string, isBlocked);
|
||||
}
|
||||
|
||||
if (details.admins?.length) {
|
||||
|
@ -321,12 +326,12 @@ export async function leaveClosedGroup(groupId: string) {
|
|||
received_at: now,
|
||||
expireTimer: 0,
|
||||
});
|
||||
getMessageController().register(dbMessage.id, dbMessage);
|
||||
getMessageController().register(dbMessage.id as string, dbMessage);
|
||||
// Send the update to the group
|
||||
const ourLeavingMessage = new ClosedGroupMemberLeftMessage({
|
||||
timestamp: Date.now(),
|
||||
groupId,
|
||||
identifier: dbMessage.id,
|
||||
identifier: dbMessage.id as string,
|
||||
});
|
||||
|
||||
window?.log?.info(`We are leaving the group ${groupId}. Sending our leaving message.`);
|
||||
|
@ -351,7 +356,7 @@ async function sendNewName(convo: ConversationModel, name: string, messageId: st
|
|||
// Send the update to the group
|
||||
const nameChangeMessage = new ClosedGroupNameChangeMessage({
|
||||
timestamp: Date.now(),
|
||||
groupId,
|
||||
groupId: groupId as string,
|
||||
identifier: messageId,
|
||||
name,
|
||||
});
|
||||
|
@ -421,7 +426,7 @@ export async function sendRemovedMembers(
|
|||
}
|
||||
const ourNumber = UserUtils.getOurPubKeyFromCache();
|
||||
const admins = convo.get('groupAdmins') || [];
|
||||
const groupId = convo.get('id');
|
||||
const groupId = convo.get('id') as string;
|
||||
|
||||
const isCurrentUserAdmin = admins.includes(ourNumber.key);
|
||||
const isUserLeaving = removedMembers.includes(ourNumber.key);
|
||||
|
|
|
@ -565,7 +565,7 @@ export async function retrieveNextMessages(
|
|||
}
|
||||
|
||||
if (result.status !== 200) {
|
||||
window.log('retrieve result is not 200');
|
||||
window?.log?.warn('retrieve result is not 200');
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
@ -909,7 +909,7 @@ export async function lokiOnionFetch(
|
|||
throw new Error(ERROR_CODE_NO_CONNECT);
|
||||
}
|
||||
if (e?.message === CLOCK_OUT_OF_SYNC_MESSAGE_ERROR) {
|
||||
window?.log?.warn('Its an clock out of sync error ');
|
||||
window?.log?.warn('Its a clock out of sync error ');
|
||||
throw new pRetry.AbortError(CLOCK_OUT_OF_SYNC_MESSAGE_ERROR);
|
||||
}
|
||||
throw e;
|
||||
|
|
|
@ -202,6 +202,9 @@ export class SwarmPolling {
|
|||
const messages = _.uniqBy(_.flatten(results), (x: any) => x.hash);
|
||||
|
||||
if (isGroup) {
|
||||
window?.log?.info(
|
||||
`Polled for group(${pubkey}): group.pubkey, got ${messages.length} messages back.`
|
||||
);
|
||||
// update the last fetched timestamp
|
||||
this.groupPolling = this.groupPolling.map(group => {
|
||||
if (PubKey.isEqual(pubkey, group.pubkey)) {
|
||||
|
|
|
@ -47,7 +47,7 @@ export async function start(options: any = {}) {
|
|||
export function stop() {
|
||||
enabled = false;
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
global.clearTimeout(timeout);
|
||||
timeout = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ export const createTaskWithTimeout = (task: any, id: string, givenTimeout?: numb
|
|||
const localTimer = timer;
|
||||
if (localTimer) {
|
||||
timer = null;
|
||||
clearTimeout(localTimer);
|
||||
global.clearTimeout(localTimer);
|
||||
}
|
||||
} catch (error) {
|
||||
window?.log?.error(
|
||||
|
|
|
@ -122,7 +122,7 @@ const getValidClosedGroups = async (convos: Array<ConversationModel>) => {
|
|||
c =>
|
||||
!!c.get('active_at') &&
|
||||
c.isMediumGroup() &&
|
||||
c.get('members').includes(ourPubKey) &&
|
||||
c.get('members')?.includes(ourPubKey) &&
|
||||
!c.get('left') &&
|
||||
!c.get('isKickedFromGroup') &&
|
||||
!c.isBlocked() &&
|
||||
|
@ -138,7 +138,7 @@ const getValidClosedGroups = async (convos: Array<ConversationModel>) => {
|
|||
}
|
||||
|
||||
return new ConfigurationMessageClosedGroup({
|
||||
publicKey: groupPubKey,
|
||||
publicKey: groupPubKey as string,
|
||||
name: c.get('name') || '',
|
||||
members: c.get('members') || [],
|
||||
admins: c.get('groupAdmins') || [],
|
||||
|
@ -188,7 +188,7 @@ const getValidContacts = (convos: Array<ConversationModel>) => {
|
|||
}
|
||||
|
||||
return new ConfigurationMessageContact({
|
||||
publicKey: c.id,
|
||||
publicKey: c.id as string,
|
||||
displayName: c.getLokiProfile()?.displayName,
|
||||
profilePictureURL: c.get('avatarPointer'),
|
||||
profileKey: !profileKeyForContact?.length ? undefined : profileKeyForContact,
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
import { LightBoxOptions } from '../../components/session/conversation/SessionConversation';
|
||||
import { ReplyingToMessageProps } from '../../components/session/conversation/SessionCompositionBox';
|
||||
import { QuotedAttachmentType } from '../../components/conversation/Quote';
|
||||
import { perfEnd, perfStart } from '../../session/utils/Performance';
|
||||
|
||||
export type MessageModelProps = {
|
||||
propsForMessage: PropsForMessage;
|
||||
|
@ -598,10 +599,12 @@ const conversationsSlice = createSlice({
|
|||
}>
|
||||
>
|
||||
) {
|
||||
perfStart('messagesAdded');
|
||||
action.payload.forEach(added => {
|
||||
// tslint:disable-next-line: no-parameter-reassignment
|
||||
state = handleMessageAdded(state, added);
|
||||
});
|
||||
perfEnd('messagesAdded', 'messagesAdded');
|
||||
|
||||
return state;
|
||||
},
|
||||
|
|
|
@ -80,7 +80,7 @@ describe('SwarmPolling', () => {
|
|||
ConversationTypeEnum.GROUP
|
||||
);
|
||||
convo.set('active_at', Date.now() - 3555);
|
||||
expect(swarmPolling.TEST_getPollingTimeout(PubKey.cast(convo.id))).to.eq(
|
||||
expect(swarmPolling.TEST_getPollingTimeout(PubKey.cast(convo.id as string))).to.eq(
|
||||
SWARM_POLLING_TIMEOUT.ACTIVE
|
||||
);
|
||||
});
|
||||
|
@ -91,7 +91,7 @@ describe('SwarmPolling', () => {
|
|||
ConversationTypeEnum.GROUP
|
||||
);
|
||||
convo.set('active_at', undefined);
|
||||
expect(swarmPolling.TEST_getPollingTimeout(PubKey.cast(convo.id))).to.eq(
|
||||
expect(swarmPolling.TEST_getPollingTimeout(PubKey.cast(convo.id as string))).to.eq(
|
||||
SWARM_POLLING_TIMEOUT.INACTIVE
|
||||
);
|
||||
});
|
||||
|
@ -102,7 +102,7 @@ describe('SwarmPolling', () => {
|
|||
ConversationTypeEnum.GROUP
|
||||
);
|
||||
convo.set('active_at', Date.now() - 1000 * 3600 * 23);
|
||||
expect(swarmPolling.TEST_getPollingTimeout(PubKey.cast(convo.id))).to.eq(
|
||||
expect(swarmPolling.TEST_getPollingTimeout(PubKey.cast(convo.id as string))).to.eq(
|
||||
SWARM_POLLING_TIMEOUT.MEDIUM_ACTIVE
|
||||
);
|
||||
});
|
||||
|
@ -113,7 +113,7 @@ describe('SwarmPolling', () => {
|
|||
ConversationTypeEnum.GROUP
|
||||
);
|
||||
convo.set('active_at', Date.now() - 1000 * 3600 * 25);
|
||||
expect(swarmPolling.TEST_getPollingTimeout(PubKey.cast(convo.id))).to.eq(
|
||||
expect(swarmPolling.TEST_getPollingTimeout(PubKey.cast(convo.id as string))).to.eq(
|
||||
SWARM_POLLING_TIMEOUT.INACTIVE
|
||||
);
|
||||
});
|
||||
|
@ -150,7 +150,7 @@ describe('SwarmPolling', () => {
|
|||
ConversationTypeEnum.GROUP
|
||||
);
|
||||
convo.set('active_at', Date.now());
|
||||
const groupConvoPubkey = PubKey.cast(convo.id);
|
||||
const groupConvoPubkey = PubKey.cast(convo.id as string);
|
||||
swarmPolling.addGroupId(groupConvoPubkey);
|
||||
await swarmPolling.start(true);
|
||||
|
||||
|
@ -167,7 +167,7 @@ describe('SwarmPolling', () => {
|
|||
);
|
||||
|
||||
convo.set('active_at', 1);
|
||||
const groupConvoPubkey = PubKey.cast(convo.id);
|
||||
const groupConvoPubkey = PubKey.cast(convo.id as string);
|
||||
swarmPolling.addGroupId(groupConvoPubkey);
|
||||
await swarmPolling.start(true);
|
||||
|
||||
|
@ -184,7 +184,7 @@ describe('SwarmPolling', () => {
|
|||
);
|
||||
|
||||
convo.set('active_at', 1);
|
||||
const groupConvoPubkey = PubKey.cast(convo.id);
|
||||
const groupConvoPubkey = PubKey.cast(convo.id as string);
|
||||
swarmPolling.addGroupId(groupConvoPubkey);
|
||||
await swarmPolling.start(true);
|
||||
|
||||
|
@ -202,7 +202,7 @@ describe('SwarmPolling', () => {
|
|||
);
|
||||
|
||||
convo.set('active_at', Date.now());
|
||||
const groupConvoPubkey = PubKey.cast(convo.id);
|
||||
const groupConvoPubkey = PubKey.cast(convo.id as string);
|
||||
swarmPolling.addGroupId(groupConvoPubkey);
|
||||
await swarmPolling.start(true);
|
||||
clock.tick(6000);
|
||||
|
@ -222,7 +222,7 @@ describe('SwarmPolling', () => {
|
|||
);
|
||||
|
||||
convo.set('active_at', Date.now());
|
||||
const groupConvoPubkey = PubKey.cast(convo.id);
|
||||
const groupConvoPubkey = PubKey.cast(convo.id as string);
|
||||
swarmPolling.addGroupId(groupConvoPubkey);
|
||||
await swarmPolling.start(true);
|
||||
|
||||
|
@ -243,7 +243,7 @@ describe('SwarmPolling', () => {
|
|||
);
|
||||
|
||||
convo.set('active_at', Date.now());
|
||||
const groupConvoPubkey = PubKey.cast(convo.id);
|
||||
const groupConvoPubkey = PubKey.cast(convo.id as string);
|
||||
swarmPolling.addGroupId(groupConvoPubkey);
|
||||
await swarmPolling.start(true);
|
||||
|
||||
|
@ -268,7 +268,7 @@ describe('SwarmPolling', () => {
|
|||
);
|
||||
|
||||
convo.set('active_at', Date.now());
|
||||
groupConvoPubkey = PubKey.cast(convo.id);
|
||||
groupConvoPubkey = PubKey.cast(convo.id as string);
|
||||
swarmPolling.addGroupId(groupConvoPubkey);
|
||||
await swarmPolling.start(true);
|
||||
});
|
||||
|
|
58
yarn.lock
58
yarn.lock
|
@ -692,10 +692,10 @@
|
|||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react-dom@16.8.2":
|
||||
version "16.8.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.8.2.tgz#9bd7d33f908b243ff0692846ef36c81d4941ad12"
|
||||
integrity sha512-MX7n1wq3G/De15RGAAqnmidzhr2Y9O/ClxPxyqaNg96pGyeXUYPSvujgzEVpLo9oIP4Wn1UETl+rxTN02KEpBw==
|
||||
"@types/react-dom@^17.0.2":
|
||||
version "17.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.9.tgz#441a981da9d7be117042e1a6fd3dac4b30f55add"
|
||||
integrity sha512-wIvGxLfgpVDSAMH5utdL9Ngm5Owu0VsGmldro3ORLXV8CShrL8awVj06NuEXFQ5xyaYfdca7Sgbk/50Ri1GdPg==
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
|
@ -753,14 +753,6 @@
|
|||
"@types/prop-types" "*"
|
||||
csstype "^2.2.0"
|
||||
|
||||
"@types/react@16.8.5":
|
||||
version "16.8.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.5.tgz#03b9a6597bc20f6eaaed43f377a160f7e41c2b90"
|
||||
integrity sha512-8LRySaaSJVLNZb2dbOGvGmzn88cbAfrgDpuWy+6lLgQ0OJFgHHvyuaCX4/7ikqJlpmCPf4uazJAZcfTQRdJqdQ==
|
||||
dependencies:
|
||||
"@types/prop-types" "*"
|
||||
csstype "^2.2.0"
|
||||
|
||||
"@types/react@^16.8.3":
|
||||
version "16.14.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.7.tgz#b62bd8cc4675d6fe3976126cdd208deda267f1fb"
|
||||
|
@ -770,6 +762,15 @@
|
|||
"@types/scheduler" "*"
|
||||
csstype "^3.0.2"
|
||||
|
||||
"@types/react@^17.0.15":
|
||||
version "17.0.15"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.15.tgz#c7533dc38025677e312606502df7656a6ea626d0"
|
||||
integrity sha512-uTKHDK9STXFHLaKv6IMnwp52fm0hwU+N89w/p9grdUqcFA6WuqDyPhaWopbNyE1k/VhgzmHl8pu1L4wITtmlLw==
|
||||
dependencies:
|
||||
"@types/prop-types" "*"
|
||||
"@types/scheduler" "*"
|
||||
csstype "^3.0.2"
|
||||
|
||||
"@types/redux-logger@3.0.7":
|
||||
version "3.0.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/redux-logger/-/redux-logger-3.0.7.tgz#163f6f6865c69c21d56f9356dc8d741718ec0db0"
|
||||
|
@ -7496,15 +7497,14 @@ react-contexify@5.0.0:
|
|||
dependencies:
|
||||
clsx "^1.1.1"
|
||||
|
||||
react-dom@16.8.3:
|
||||
version "16.8.3"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.3.tgz#ae236029e66210783ac81999d3015dfc475b9c32"
|
||||
integrity sha512-ttMem9yJL4/lpItZAQ2NTFAbV7frotHk5DZEHXUOws2rMmrsvh1Na7ThGT0dTzUIl6pqTOi5tYREfL8AEna3lA==
|
||||
react-dom@^17.0.2:
|
||||
version "17.0.2"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
|
||||
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.2"
|
||||
scheduler "^0.13.3"
|
||||
scheduler "^0.20.2"
|
||||
|
||||
react-emoji-render@^1.2.4:
|
||||
version "1.2.4"
|
||||
|
@ -7649,19 +7649,13 @@ react-virtualized@9.22.3:
|
|||
prop-types "^15.7.2"
|
||||
react-lifecycles-compat "^3.0.4"
|
||||
|
||||
react-window-infinite-loader@^1.0.7:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/react-window-infinite-loader/-/react-window-infinite-loader-1.0.7.tgz#958ef1a689d20dce122ef377583acd987760aee8"
|
||||
integrity sha512-wg3LWkUpG21lhv+cZvNy+p0+vtclZw+9nP2vO6T9PKT50EN1cUq37Dq6FzcM38h/c2domE0gsUhb6jHXtGogAA==
|
||||
|
||||
react@^16.13.1:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
|
||||
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
|
||||
react@^17.0.2:
|
||||
version "17.0.2"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
|
||||
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.2"
|
||||
|
||||
read-config-file@6.0.0:
|
||||
version "6.0.0"
|
||||
|
@ -8213,10 +8207,10 @@ sax@^1.2.4:
|
|||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
|
||||
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
|
||||
|
||||
scheduler@^0.13.3:
|
||||
version "0.13.6"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
|
||||
integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
|
||||
scheduler@^0.20.2:
|
||||
version "0.20.2"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
|
||||
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
|
|
Loading…
Reference in a new issue