Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
e754c621
Commit
e754c621
authored
Jan 13, 2021
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated HashtagTimeline to not take in multiple tags
• Updated: - HashtagTimeline to not take in multiple tags
parent
8aeae9c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
69 deletions
+9
-69
app/javascript/gabsocial/actions/timelines.js
app/javascript/gabsocial/actions/timelines.js
+1
-4
app/javascript/gabsocial/features/hashtag_timeline.js
app/javascript/gabsocial/features/hashtag_timeline.js
+8
-65
No files found.
app/javascript/gabsocial/actions/timelines.js
View file @
e754c621
...
...
@@ -336,11 +336,8 @@ export const expandLinkTimeline = (linkId, { maxId } = {}, done = noop) => {
/**
*
*/
export
const
expandHashtagTimeline
=
(
hashtag
,
{
maxId
,
tags
}
=
{},
done
=
noop
)
=>
{
export
const
expandHashtagTimeline
=
(
hashtag
,
{
maxId
}
=
{},
done
=
noop
)
=>
{
return
expandTimeline
(
`hashtag:
${
hashtag
}
`
,
`/api/v1/timelines/tag/
${
hashtag
}
`
,
{
max_id
:
maxId
,
any
:
parseTags
(
tags
,
'
any
'
),
all
:
parseTags
(
tags
,
'
all
'
),
none
:
parseTags
(
tags
,
'
none
'
),
},
done
)
}
app/javascript/gabsocial/features/hashtag_timeline.js
View file @
e754c621
...
...
@@ -9,88 +9,31 @@ import StatusList from '../components/status_list'
class
HashtagTimeline
extends
React
.
PureComponent
{
title
=
()
=>
{
const
title
=
[
this
.
props
.
params
.
id
]
if
(
this
.
additionalFor
(
'
any
'
))
{
title
.
push
(
'
'
,
<
FormattedMessage
key
=
'
any
'
id
=
'
hashtag.column_header.tag_mode.any
'
values
=
{{
additional
:
this
.
additionalFor
(
'
any
'
),
}}
defaultMessage
=
'
or {additional}
'
/>
)
}
if
(
this
.
additionalFor
(
'
all
'
))
{
title
.
push
(
'
'
,
<
FormattedMessage
key
=
'
all
'
id
=
'
hashtag.column_header.tag_mode.all
'
values
=
{{
additional
:
this
.
additionalFor
(
'
all
'
),
}}
defaultMessage
=
'
and {additional}
'
/>
)
}
if
(
this
.
additionalFor
(
'
none
'
))
{
title
.
push
(
'
'
,
<
FormattedMessage
key
=
'
none
'
id
=
'
hashtag.column_header.tag_mode.none
'
values
=
{{
additional
:
this
.
additionalFor
(
'
none
'
),
}}
defaultMessage
=
'
without {additional}
'
/>
)
}
return
title
}
additionalFor
=
(
mode
)
=>
{
const
{
tags
}
=
this
.
props
.
params
try
{
return
tags
[
mode
].
map
(
tag
=>
tag
.
value
).
join
(
'
/
'
)
}
catch
(
error
)
{
return
''
}
}
componentDidMount
()
{
const
{
dispatch
,
tagName
}
=
this
.
props
const
{
id
,
tags
}
=
this
.
props
.
params
const
{
id
}
=
this
.
props
.
params
dispatch
(
expandHashtagTimeline
(
id
,
{
tags
}
))
dispatch
(
expandHashtagTimeline
(
id
))
// dispatch(fetchHashtag(tagName))
}
componentWillReceiveProps
(
nextProps
)
{
const
{
dispatch
,
params
}
=
this
.
props
const
{
id
,
tags
}
=
nextProps
.
params
const
{
id
}
=
nextProps
.
params
if
(
id
!==
params
.
id
||
!
isEqual
(
tags
,
params
.
tags
)
)
{
if
(
id
!==
params
.
id
)
{
this
.
props
.
dispatch
(
clearTimeline
(
`hashtag:
${
id
}
`
))
this
.
props
.
dispatch
(
expandHashtagTimeline
(
id
,
{
tags
}
))
this
.
props
.
dispatch
(
expandHashtagTimeline
(
id
))
}
}
handleLoadMore
=
(
maxId
)
=>
{
const
{
id
,
tags
}
=
this
.
props
.
params
this
.
props
.
dispatch
(
expandHashtagTimeline
(
id
,
{
maxId
,
tags
}))
const
{
id
}
=
this
.
props
.
params
this
.
props
.
dispatch
(
expandHashtagTimeline
(
id
,
{
maxId
}))
}
render
()
{
const
{
tag
,
tagName
}
=
this
.
props
console
.
log
(
"
tagName:
"
,
tag
)
const
{
tagName
}
=
this
.
props
return
(
<
StatusList
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment