mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
fixed crash on leftpaneContactSection
This commit is contained in:
parent
3e27a397d7
commit
1b2a644e7a
2
.github/workflows/build-binaries.yml
vendored
2
.github/workflows/build-binaries.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
- name: Install node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.19.0
|
||||
node-version: 14.16.0
|
||||
|
||||
- name: Chocolatey Install Action
|
||||
if: runner.os == 'Windows'
|
||||
|
|
2
.github/workflows/pull-request.yml
vendored
2
.github/workflows/pull-request.yml
vendored
|
@ -25,7 +25,7 @@ jobs:
|
|||
- name: Install node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.19.0
|
||||
node-version: 14.16.0
|
||||
|
||||
- name: Chocolatey Install Action
|
||||
if: runner.os == 'Windows'
|
||||
|
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
- name: Install node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 10.19.0
|
||||
node-version: 14.16.0
|
||||
|
||||
- name: Chocolatey Install Action
|
||||
if: runner.os == 'Windows'
|
||||
|
|
24
app/sql.js
24
app/sql.js
|
@ -8,9 +8,7 @@ const { remove: removeUserConfig } = require('./user_config');
|
|||
|
||||
const { map, isString, fromPairs, forEach, last, isEmpty, isObject, isNumber } = require('lodash');
|
||||
|
||||
// To get long stack traces
|
||||
// https://github.com/mapbox/node-sqlite3/wiki/API#sqlite3verbose
|
||||
// sql.verbose();
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
module.exports = {
|
||||
initialize,
|
||||
|
@ -1407,7 +1405,7 @@ function createOrUpdate(table, data, instance) {
|
|||
)`
|
||||
)
|
||||
.run({
|
||||
id: id,
|
||||
id,
|
||||
json: objectToJSON(data),
|
||||
});
|
||||
}
|
||||
|
@ -1483,15 +1481,7 @@ function getConversationCount() {
|
|||
}
|
||||
|
||||
function saveConversation(data) {
|
||||
const {
|
||||
id,
|
||||
// eslint-disable-next-line camelcase
|
||||
active_at,
|
||||
type,
|
||||
members,
|
||||
name,
|
||||
profileName,
|
||||
} = data;
|
||||
const { id, active_at, type, members, name, profileName } = data;
|
||||
|
||||
globalInstance
|
||||
.prepare(
|
||||
|
@ -1700,7 +1690,7 @@ function searchMessages(query, { limit } = {}) {
|
|||
LIMIT $limit;`
|
||||
)
|
||||
.all({
|
||||
query: query,
|
||||
query,
|
||||
limit: limit || 100,
|
||||
});
|
||||
|
||||
|
@ -2119,7 +2109,7 @@ function getLastHashBySnode(convoId, snode) {
|
|||
const row = globalInstance
|
||||
.prepare('SELECT * FROM lastHashes WHERE snode = $snode AND id = $id;')
|
||||
.get({
|
||||
snode: snode,
|
||||
snode,
|
||||
id: convoId,
|
||||
});
|
||||
|
||||
|
@ -2226,8 +2216,8 @@ function saveUnprocessed(data) {
|
|||
|
||||
function updateUnprocessedAttempts(id, attempts) {
|
||||
globalInstance.prepare('UPDATE unprocessed SET attempts = $attempts WHERE id = $id;').run({
|
||||
id: id,
|
||||
attempts: attempts,
|
||||
id,
|
||||
attempts,
|
||||
});
|
||||
}
|
||||
function updateUnprocessedWithData(id, data = {}) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global dcodeIO */
|
||||
/* global dcodeIO, Internal */
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable strict */
|
||||
|
||||
const functions = {
|
||||
|
|
|
@ -5,16 +5,18 @@ import { RowRendererParamsType } from '../LeftPane';
|
|||
import { AutoSizer, List } from 'react-virtualized';
|
||||
import { LeftPaneSectionHeader } from './LeftPaneSectionHeader';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { getDirectContacts, getLeftPaneLists } from '../../state/selectors/conversations';
|
||||
import { isSearching } from '../../state/selectors/search';
|
||||
import { getDirectContacts } from '../../state/selectors/conversations';
|
||||
|
||||
const renderRow = ({ index, key, style }: RowRendererParamsType) => {
|
||||
const showSearch = useSelector(isSearching);
|
||||
const renderRow = (props: RowRendererParamsType) => {
|
||||
const { index, key, style } = props;
|
||||
|
||||
const lists = showSearch ? undefined : useSelector(getLeftPaneLists);
|
||||
const directContacts = (props.parent as any)?.props?.directContacts || [];
|
||||
|
||||
const directContacts = lists?.contacts || [];
|
||||
const item = directContacts[index];
|
||||
const item = directContacts?.[index];
|
||||
|
||||
if (!item) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <MemoConversationListItemWithDetails style={style} key={key} {...item} />;
|
||||
};
|
||||
|
@ -25,6 +27,7 @@ const ContactListItemSection = () => {
|
|||
if (!directContacts) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const length = Number(directContacts.length);
|
||||
|
||||
return (
|
||||
|
|
|
@ -16,17 +16,16 @@ import { SessionTheme } from '../../../state/ducks/SessionTheme';
|
|||
import { DefaultTheme } from 'styled-components';
|
||||
import { SessionMessagesList } from './SessionMessagesList';
|
||||
import { LightboxGallery, MediaItemType } from '../../LightboxGallery';
|
||||
import { Message } from '../../conversation/media-gallery/types/Message';
|
||||
|
||||
import { AttachmentType, AttachmentTypeWithPath, save } from '../../../types/Attachment';
|
||||
import { ToastUtils, UserUtils } from '../../../session/utils';
|
||||
import * as MIME from '../../../types/MIME';
|
||||
import { SessionFileDropzone } from './SessionFileDropzone';
|
||||
import {
|
||||
ReduxConversationType,
|
||||
PropsForMessage,
|
||||
SortedMessageModelProps,
|
||||
fetchMessagesForConversation,
|
||||
PropsForMessage,
|
||||
ReduxConversationType,
|
||||
SortedMessageModelProps,
|
||||
} from '../../../state/ducks/conversations';
|
||||
import { MessageView } from '../../MainViewController';
|
||||
import { pushUnblockToSend } from '../../../session/utils/Toast';
|
||||
|
@ -36,7 +35,6 @@ import { getMessageById, getPubkeysInPublicConversation } from '../../../data/da
|
|||
import autoBind from 'auto-bind';
|
||||
import { getDecryptedMediaUrl } from '../../../session/crypto/DecryptedAttachmentsManager';
|
||||
import { deleteOpenGroupMessages } from '../../../interactions/conversationInteractions';
|
||||
import { ConversationTypeEnum } from '../../../models/conversation';
|
||||
import { updateMentionsMembers } from '../../../state/ducks/mentionsInput';
|
||||
import { sendDataExtractionNotification } from '../../../session/messages/outgoing/controlMessage/DataExtractionNotificationMessage';
|
||||
|
||||
|
|
Loading…
Reference in a new issue