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

Commit 6da5ae0

Browse files
authored
Merge pull request #3307 from withspectrum/2.4.8
2.4.8
2 parents e69a639 + a91b02e commit 6da5ae0

File tree

9 files changed

+58
-7
lines changed

9 files changed

+58
-7
lines changed

hyperion/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ if (process.env.NODE_ENV === 'development') {
154154

155155
app.get('*', (req: express$Request, res, next) => {
156156
// Electron requests should only be client-side rendered
157-
if (req.headers['user-agent'].indexOf('Electron') > -1) {
157+
if (
158+
req.headers['user-agent'] &&
159+
req.headers['user-agent'].indexOf('Electron') > -1
160+
) {
158161
return res.sendFile(path.resolve(__dirname, '../build/index.html'));
159162
}
160163
next();

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.7",
3+
"version": "2.4.8",
44
"license": "BSD-3-Clause",
55
"devDependencies": {
66
"babel-cli": "^6.24.1",

shared/middlewares/thread-param.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const threadParamRedirect = (req, res, next) => {
44
// Redirect /?t=asdf123 if the user isn't logged in
5-
if (!req.user && req.query.t) {
5+
if (req.query.t) {
66
res.redirect(`/thread/${req.query.t}`);
77
// Redirect /anything?thread=asdf123
88
} else if (req.query.thread) {

src/components/profile/style.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @flow
12
import styled from 'styled-components';
23
import Link from 'src/components/link';
34
import {
@@ -261,6 +262,11 @@ export const ProfileCard = styled(Card)`
261262
}
262263
`;
263264

265+
export const ThreadProfileCard = styled(ProfileCard)`
266+
border-radius: 8px;
267+
box-shadow: ${Shadow.low} ${({ theme }) => hexa(theme.text.default, 0.1)};
268+
`;
269+
264270
export const ProUpgrade = styled.div`
265271
margin: 16px;
266272
margin-top: 0;

src/components/profile/thread.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import compose from 'recompose/compose';
55
import Link from 'src/components/link';
66
import { connect } from 'react-redux';
77
import { ThreadListItem } from '../listItems';
8-
import { ProfileCard } from './style';
8+
import { ThreadProfileCard } from './style';
99
import type { GetThreadType } from 'shared/graphql/queries/thread/getThread';
1010

1111
type Props = {
@@ -39,7 +39,7 @@ class ThreadWithData extends React.Component<Props> {
3939
}
4040

4141
return (
42-
<ProfileCard>
42+
<ThreadProfileCard>
4343
<Link
4444
to={{
4545
search: `?thread=${thread.id}`,
@@ -53,7 +53,7 @@ class ThreadWithData extends React.Component<Props> {
5353
}`}
5454
/>
5555
</Link>
56-
</ProfileCard>
56+
</ThreadProfileCard>
5757
);
5858
}
5959
}

src/views/community/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ class CommunityView extends React.Component<Props, State> {
290290
icon={isMember ? 'checkmark' : null}
291291
loading={state.isLoading}
292292
dataCy={'join-community-button'}
293+
style={{ marginTop: '16px' }}
293294
>
294295
{isMember ? 'Member' : `Join ${community.name}`}
295296
</LoginButton>

src/views/notifications/components/newMessageNotification.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ export const NewMessageNotification = ({ notification, currentUser }) => {
3131
const date = parseNotificationDate(notification.modifiedAt);
3232
const context = parseContext(notification.context, currentUser);
3333
const unsortedMessages = notification.entities.map(notif => notif.payload);
34-
const messages = sortAndGroupNotificationMessages(unsortedMessages);
34+
let messages = sortAndGroupNotificationMessages(unsortedMessages);
35+
36+
if (messages.length > 3) {
37+
messages = messages.splice(0, messages.length - 3);
38+
}
3539

3640
return (
3741
<NotificationCard isSeen={notification.isSeen}>

src/views/notifications/style.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export const NotificationCard = styled(Card)`
2323
padding-bottom: 24px;
2424
overflow: hidden;
2525
transition: ${Transition.hover.off};
26+
border-radius: 8px;
27+
box-shadow: ${Shadow.low} ${({ theme }) => hexa(theme.text.default, 0.1)};
2628
2729
&:hover {
2830
transition: none;
@@ -34,6 +36,8 @@ export const SegmentedNotificationCard = styled(Card)`
3436
padding: 0;
3537
padding-top: 16px;
3638
transition: ${Transition.hover.off};
39+
border-radius: 8px;
40+
box-shadow: ${Shadow.low} ${({ theme }) => hexa(theme.text.default, 0.1)};
3741
3842
&:hover {
3943
transition: none;
@@ -259,6 +263,8 @@ export const RequestCard = styled(Card)`
259263
align-items: center;
260264
justify-content: space-between;
261265
padding: 16px 16px 16px 24px;
266+
border-radius: 8px;
267+
box-shadow: ${Shadow.low} ${({ theme }) => hexa(theme.text.default, 0.1)};
262268
263269
> p {
264270
font-weight: 700;

src/views/thread/components/actionBar.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,37 @@ class ActionBar extends React.Component<Props, State> {
385385
</Clipboard>
386386
</ShareButtons>
387387
)}
388+
{thread.channel.isPrivate && (
389+
<ShareButtons>
390+
<Clipboard
391+
style={{ background: 'none' }}
392+
data-clipboard-text={`https://spectrum.chat/thread/${
393+
thread.id
394+
}`}
395+
onSuccess={() =>
396+
this.props.dispatch(
397+
addToastWithTimeout('success', 'Copied to clipboard')
398+
)
399+
}
400+
>
401+
<ShareButton
402+
tipText={'Copy link'}
403+
tipLocation={'top-left'}
404+
data-cy="thread-copy-link-button"
405+
>
406+
<a>
407+
<Icon
408+
glyph={'link'}
409+
size={24}
410+
onClick={() =>
411+
track(events.THREAD_SHARED, { method: 'link' })
412+
}
413+
/>
414+
</a>
415+
</ShareButton>
416+
</Clipboard>
417+
</ShareButtons>
418+
)}
388419
</div>
389420

390421
<div style={{ display: 'flex' }}>

0 commit comments

Comments
 (0)