Skip to content

Commit e7f653c

Browse files
thread creator update fixed
1 parent 983eedf commit e7f653c

File tree

7 files changed

+36
-16
lines changed

7 files changed

+36
-16
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
1010
versionCode 1
11-
versionName "1.3.32"
11+
versionName "1.3.33"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
aaptOptions {
1414
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

info/dev/preparing-changelog.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
- thread issue fixed.
2-
- crypto issue fixed.
1+
- Thread creator update fixed

ios/App/App.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
INFOPLIST_FILE = App/Info.plist;
351351
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
352352
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
353-
MARKETING_VERSION = 1.3.32;
353+
MARKETING_VERSION = 1.3.33;
354354
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
355355
PRODUCT_BUNDLE_IDENTIFIER = pony.house.matrix;
356356
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -370,7 +370,7 @@
370370
INFOPLIST_FILE = App/Info.plist;
371371
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
372372
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
373-
MARKETING_VERSION = 1.3.32;
373+
MARKETING_VERSION = 1.3.33;
374374
PRODUCT_BUNDLE_IDENTIFIER = pony.house.matrix;
375375
PRODUCT_NAME = "$(TARGET_NAME)";
376376
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pony-house-matrix",
3-
"version": "1.3.32",
3+
"version": "1.3.33",
44
"short_name": "Pony House",
55
"description": "The open source house, your house, the house for all matrix ponies",
66
"main": "dist-electron/main/index.js",

src/app/molecules/message/Message.jsx

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
/* eslint-disable react/prop-types */
1+
/* eslint-disable react-hooks/rules-of-hooks */
22
import React, { useState, useEffect, useCallback, useRef } from 'react';
33
import PropTypes from 'prop-types';
4+
import generateApiKey from 'generate-api-key';
45

56
import { MatrixEventEvent, RoomEvent, THREAD_RELATION_TYPE } from 'matrix-js-sdk';
67

78
import clone from 'clone';
89
import hljs from 'highlight.js';
910
import * as linkify from 'linkifyjs';
11+
import cons from '@src/client/state/cons';
1012

1113
import Text from '../../atoms/text/Text';
1214
import { hljsFixer, resizeWindowChecker, toast } from '../../../util/tools';
@@ -770,7 +772,6 @@ function MessageReactionGroup({ roomTimeline, mEvent }) {
770772
.sort((a, b) => reactions[a].index - reactions[b].index)
771773
.slice(0, reactionLimit);
772774

773-
// eslint-disable-next-line react-hooks/rules-of-hooks
774775
useEffect(() => mediaFix(itemEmbed, embedHeight, setEmbedHeight));
775776

776777
return (
@@ -895,7 +896,6 @@ const MessageOptions = React.memo(
895896
selectRoom(roomId, eventId, eventId);
896897
};
897898

898-
// eslint-disable-next-line react-hooks/rules-of-hooks
899899
useEffect(() => {
900900
const newForceThread = (value) => setIsForceThreadVisible(value);
901901
matrixAppearance.on('forceThreadButton', newForceThread);
@@ -1065,8 +1065,12 @@ const MessageThreadSummary = React.memo(({ thread }) => {
10651065
selectRoom(thread.roomId, undefined, thread.rootEvent?.getId());
10661066
}
10671067

1068-
thread.on(RoomEvent.Timeline, () => {
1069-
setLastReply(thread.lastReply());
1068+
useEffect(() => {
1069+
const threadTimelineUpdate = () => setLastReply(thread.lastReply());
1070+
thread.on(RoomEvent.Timeline, threadTimelineUpdate);
1071+
return () => {
1072+
thread.off(RoomEvent.Timeline, threadTimelineUpdate);
1073+
};
10701074
});
10711075

10721076
return (
@@ -1260,13 +1264,15 @@ function Message({
12601264
refRoomInput,
12611265
}) {
12621266
// Get Room Data
1267+
const { notifications } = initMatrix;
12631268
const appearanceSettings = getAppearance();
12641269
$(timelineSVRef?.current).trigger('scroll');
12651270
const mx = initMatrix.matrixClient;
12661271
const roomId = mEvent.getRoomId();
12671272
const threadId = mEvent.getThread()?.id;
12681273
const { editedTimeline, reactionTimeline } = roomTimeline ?? {};
12691274

1275+
const [existThread, updateExistThread] = useState(typeof threadId === 'string');
12701276
const [embeds, setEmbeds] = useState([]);
12711277
const [embedHeight, setEmbedHeight] = useState(null);
12721278
const itemEmbed = useRef(null);
@@ -1368,7 +1374,6 @@ function Message({
13681374
}
13691375
}
13701376

1371-
// eslint-disable-next-line react-hooks/rules-of-hooks
13721377
useEffect(() => {
13731378
const bodyUrls = [];
13741379
if (typeof body === 'string' && body.length > 0) {
@@ -1466,9 +1471,22 @@ function Message({
14661471
};
14671472
}, []);
14681473

1469-
// eslint-disable-next-line react-hooks/rules-of-hooks
14701474
useEffect(() => mediaFix(itemEmbed, embedHeight, setEmbedHeight));
14711475

1476+
useEffect(() => {
1477+
const threadUpdate = (tth) => {
1478+
const thread = mEvent.getThread();
1479+
if (thread && tth.id === thread.id) {
1480+
if (!existThread) updateExistThread(true);
1481+
}
1482+
};
1483+
1484+
notifications.on(cons.events.notifications.THREAD_NOTIFICATION, threadUpdate);
1485+
return () => {
1486+
notifications.off(cons.events.notifications.THREAD_NOTIFICATION, threadUpdate);
1487+
};
1488+
});
1489+
14721490
// Normal Message
14731491
if (msgType !== 'm.bad.encrypted') {
14741492
// Return Data
@@ -1553,7 +1571,12 @@ function Message({
15531571
<div ref={itemEmbed} className="message-embed message-url-embed">
15541572
{embeds.map((embed) => {
15551573
if (embed.data)
1556-
return <Embed key={`msg_embed_${embed.eventId}`} embed={embed.data} />;
1574+
return (
1575+
<Embed
1576+
key={`msg_embed_${embed.eventId}_${generateApiKey()}`}
1577+
embed={embed.data}
1578+
/>
1579+
);
15571580
})}
15581581
</div>
15591582
) : null}

src/app/organisms/navigation/Selector.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/prop-types */
21
import React, { useEffect, useState } from 'react';
32
import PropTypes from 'prop-types';
43

src/app/organisms/room/RoomViewInput.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/prop-types */
21
import React, { useState, useEffect, useRef } from 'react';
32
import PropTypes from 'prop-types';
43
import TextareaAutosize from 'react-autosize-textarea';

0 commit comments

Comments
 (0)