Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
15963a15
Commit
15963a15
authored
7 years ago
by
Yamagishi Kazutoshi
Committed by
Eugen Rochko
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Disable embed modal when private status (#4773)
* Disable embed modal when private status * Remove `reblogDisabled`
parent
1b5806b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/javascript/mastodon/components/status_action_bar.js
+10
-5
10 additions, 5 deletions
app/javascript/mastodon/components/status_action_bar.js
app/javascript/mastodon/features/status/components/action_bar.js
+6
-2
6 additions, 2 deletions
...ascript/mastodon/features/status/components/action_bar.js
with
16 additions
and
7 deletions
app/javascript/mastodon/components/status_action_bar.js
+
10
−
5
View file @
15963a15
...
...
@@ -116,9 +116,10 @@ export default class StatusActionBar extends ImmutablePureComponent {
render
()
{
const
{
status
,
me
,
intl
,
withDismiss
}
=
this
.
props
;
const
reblogDisabled
=
status
.
get
(
'
visibility
'
)
===
'
private
'
||
status
.
get
(
'
visibility
'
)
===
'
direct
'
;
const
mutingConversation
=
status
.
get
(
'
muted
'
);
const
anonymousAccess
=
!
me
;
const
anonymousAccess
=
!
me
;
const
publicStatus
=
[
'
public
'
,
'
unlisted
'
].
includes
(
status
.
get
(
'
visibility
'
));
let
menu
=
[];
let
reblogIcon
=
'
retweet
'
;
...
...
@@ -126,7 +127,11 @@ export default class StatusActionBar extends ImmutablePureComponent {
let
replyTitle
;
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
open
),
action
:
this
.
handleOpen
});
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
embed
),
action
:
this
.
handleEmbed
});
if
(
publicStatus
)
{
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
embed
),
action
:
this
.
handleEmbed
});
}
menu
.
push
(
null
);
if
(
withDismiss
)
{
...
...
@@ -135,7 +140,7 @@ export default class StatusActionBar extends ImmutablePureComponent {
}
if
(
status
.
getIn
([
'
account
'
,
'
id
'
])
===
me
)
{
if
(
[
'
public
'
,
'
unlisted
'
].
indexOf
(
status
.
get
(
'
visibility
'
))
!==
-
1
)
{
if
(
public
Status
)
{
menu
.
push
({
text
:
intl
.
formatMessage
(
status
.
get
(
'
pinned
'
)
?
messages
.
unpin
:
messages
.
pin
),
action
:
this
.
handlePinClick
});
}
...
...
@@ -169,7 +174,7 @@ export default class StatusActionBar extends ImmutablePureComponent {
return
(
<
div
className
=
'
status__action-bar
'
>
<
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
anonymousAccess
}
title
=
{
replyTitle
}
icon
=
{
replyIcon
}
onClick
=
{
this
.
handleReplyClick
}
/
>
<
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
anonymousAccess
||
reblogDisabled
}
active
=
{
status
.
get
(
'
reblogged
'
)}
pressed
=
{
status
.
get
(
'
reblogged
'
)}
title
=
{
reblogDisabled
?
intl
.
formatMessage
(
messages
.
cannot_reblog
)
:
intl
.
formatMessage
(
messages
.
reblog
)}
icon
=
{
reblogIcon
}
onClick
=
{
this
.
handleReblogClick
}
/
>
<
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
anonymousAccess
||
!
publicStatus
}
active
=
{
status
.
get
(
'
reblogged
'
)}
pressed
=
{
status
.
get
(
'
reblogged
'
)}
title
=
{
!
publicStatus
?
intl
.
formatMessage
(
messages
.
cannot_reblog
)
:
intl
.
formatMessage
(
messages
.
reblog
)}
icon
=
{
reblogIcon
}
onClick
=
{
this
.
handleReblogClick
}
/
>
<
IconButton
className
=
'
status__action-bar-button star-icon
'
disabled
=
{
anonymousAccess
}
animate
active
=
{
status
.
get
(
'
favourited
'
)}
pressed
=
{
status
.
get
(
'
favourited
'
)}
title
=
{
intl
.
formatMessage
(
messages
.
favourite
)}
icon
=
'
star
'
onClick
=
{
this
.
handleFavouriteClick
}
/
>
{
shareButton
}
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/features/status/components/action_bar.js
+
6
−
2
View file @
15963a15
...
...
@@ -82,12 +82,16 @@ export default class ActionBar extends React.PureComponent {
render
()
{
const
{
status
,
me
,
intl
}
=
this
.
props
;
const
publicStatus
=
[
'
public
'
,
'
unlisted
'
].
includes
(
status
.
get
(
'
visibility
'
));
let
menu
=
[];
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
embed
),
action
:
this
.
handleEmbed
});
if
(
publicStatus
)
{
menu
.
push
({
text
:
intl
.
formatMessage
(
messages
.
embed
),
action
:
this
.
handleEmbed
});
}
if
(
me
===
status
.
getIn
([
'
account
'
,
'
id
'
]))
{
if
(
[
'
public
'
,
'
unlisted
'
].
indexOf
(
status
.
get
(
'
visibility
'
))
!==
-
1
)
{
if
(
public
Status
)
{
menu
.
push
({
text
:
intl
.
formatMessage
(
status
.
get
(
'
pinned
'
)
?
messages
.
unpin
:
messages
.
pin
),
action
:
this
.
handlePinClick
});
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment