Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 932ee95

Browse files
authored
Merge pull request #4263 from withspectrum/2.4.70
2.4.70
2 parents aa7a732 + 62ecccc commit 932ee95

File tree

6 files changed

+55
-38
lines changed

6 files changed

+55
-38
lines changed

api/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3637,7 +3637,7 @@ draft-js-prism@^1.0.6:
36373637
extend "^3.0.0"
36383638
immutable "*"
36393639

3640-
"draft-js-prism@github:ngs/draft-js-prism#6edb31c3805dd1de3fb897cc27fced6bac1bafbb":
3640+
draft-js-prism@ngs/draft-js-prism#6edb31c3805dd1de3fb897cc27fced6bac1bafbb:
36413641
version "1.0.3"
36423642
resolved "https://codeload.github.com/ngs/draft-js-prism/tar.gz/6edb31c3805dd1de3fb897cc27fced6bac1bafbb"
36433643
dependencies:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Spectrum",
3-
"version": "2.4.69",
3+
"version": "2.4.70",
44
"license": "BSD-3-Clause",
55
"devDependencies": {
66
"@babel/preset-flow": "^7.0.0",

shared/db/queries/usersNotifications.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const markNotificationsSeen = createWriteQuery(
5050
userId,
5151
event: events.NOTIFICATIONS_MARKED_AS_SEEN,
5252
});
53+
return true;
5354
}),
5455
invalidateTags: () => [userId, ...notifications],
5556
})

shared/notification-to-text.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,19 @@ const formatNotification = (incomingNotification, currentUserId) => {
160160
}
161161
case 'REACTION_CREATED': {
162162
const message = notification.context.payload;
163-
164163
href = `/thread/${message.threadId}`;
165164
body =
166165
message.messageType.toLowerCase() === 'draftjs'
167-
? toPlainText(toState(message.content.body))
166+
? `${toPlainText(toState(JSON.parse(message.content.body)))}`
168167
: message.content.body;
169168
break;
170169
}
171170
case 'THREAD_REACTION_CREATED': {
172171
const thread = notification.context.payload;
173-
174172
href = `/thread/${thread.id}`;
175173
body =
176174
thread.type.toLowerCase() === 'draftjs'
177-
? toPlainText(toState(thread.content.body))
175+
? `${toPlainText(toState(JSON.parse(thread.content.body)))}`
178176
: thread.content.body;
179177
break;
180178
}

src/views/navbar/components/messagesTab.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ class MessagesTab extends React.Component<Props, State> {
3737
subscription: null,
3838
};
3939

40+
componentDidMount() {
41+
this.subscribe();
42+
return this.setCount(this.props);
43+
}
44+
4045
shouldComponentUpdate(nextProps) {
4146
const prevProps = this.props;
4247

@@ -59,7 +64,6 @@ class MessagesTab extends React.Component<Props, State> {
5964
nextProps.data.directMessageNotifications.edges.length
6065
)
6166
return true;
62-
6367
// if the user clicks on the messages tab
6468
if (prevProps.active !== nextProps.active) return true;
6569

@@ -149,7 +153,6 @@ class MessagesTab extends React.Component<Props, State> {
149153
} = props;
150154
const { dispatch } = this.props;
151155
const nodes = this.convertEdgesToNodes(directMessageNotifications);
152-
153156
// set to 0 if no notifications exist yet
154157
if (!nodes || nodes.length === 0) {
155158
return dispatch(

src/views/navbar/components/profileDropdown.js

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,57 @@ type ProfileProps = {
4949
dispatch: Function,
5050
};
5151

52-
const ProfileDropdown = (props: ProfileProps) => {
53-
return (
54-
<UserProfileDropdown className={'dropdown'}>
55-
<UserProfileDropdownList>
56-
{props.user.username && (
57-
<Link rel="nofollow" to={`/users/${props.user.username}/settings`}>
58-
<UserProfileDropdownListItem>
59-
My Settings
60-
</UserProfileDropdownListItem>
61-
</Link>
62-
)}
52+
type State = {
53+
didMount: boolean,
54+
};
55+
56+
class ProfileDropdown extends React.Component<ProfileProps, State> {
57+
state = { didMount: false };
58+
59+
componentDidMount() {
60+
return this.setState({ didMount: true });
61+
}
6362

64-
{isMac() &&
65-
!isDesktopApp() && (
66-
<Link to={`/apps`}>
63+
render() {
64+
const { props } = this;
65+
const { didMount } = this.state;
66+
return (
67+
<UserProfileDropdown className={'dropdown'}>
68+
<UserProfileDropdownList>
69+
{props.user.username && (
70+
<Link rel="nofollow" to={`/users/${props.user.username}/settings`}>
6771
<UserProfileDropdownListItem>
68-
Desktop App
72+
My Settings
6973
</UserProfileDropdownListItem>
7074
</Link>
7175
)}
7276

73-
<Link to={`/about`}>
74-
<UserProfileDropdownListItem>
75-
About Spectrum
76-
</UserProfileDropdownListItem>
77-
</Link>
78-
<Link to={`/support`}>
79-
<UserProfileDropdownListItem>Support</UserProfileDropdownListItem>
80-
</Link>
77+
{didMount &&
78+
isMac() &&
79+
!isDesktopApp() && (
80+
<Link to={`/apps`}>
81+
<UserProfileDropdownListItem>
82+
Desktop App
83+
</UserProfileDropdownListItem>
84+
</Link>
85+
)}
8186

82-
<a href={`${SERVER_URL}/auth/logout`}>
83-
<UserProfileDropdownListItem>Log Out</UserProfileDropdownListItem>
84-
</a>
85-
</UserProfileDropdownList>
86-
</UserProfileDropdown>
87-
);
88-
};
87+
<Link to={`/about`}>
88+
<UserProfileDropdownListItem>
89+
About Spectrum
90+
</UserProfileDropdownListItem>
91+
</Link>
92+
<Link to={`/support`}>
93+
<UserProfileDropdownListItem>Support</UserProfileDropdownListItem>
94+
</Link>
95+
96+
<a href={`${SERVER_URL}/auth/logout`}>
97+
<UserProfileDropdownListItem>Log Out</UserProfileDropdownListItem>
98+
</a>
99+
</UserProfileDropdownList>
100+
</UserProfileDropdown>
101+
);
102+
}
103+
}
89104

90105
export default connect()(ProfileDropdown);

0 commit comments

Comments
 (0)