Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social: Fix broken calypso sharing experience when toggling off connections #95541

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions client/blocks/post-share/connection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ function hasRoundIcon( service ) {
}

const PostShareConnection = ( { connection, isActive, onToggle } ) => {
const { external_display, external_profile_picture, keyring_connection_ID, service, status } =
connection;
const { external_display, external_profile_picture, ID, service, status } = connection;

const toggle = () => onToggle( keyring_connection_ID );
const toggle = () => onToggle( ID );

const classes = clsx( {
'post-share__service': true,
Expand All @@ -32,7 +31,7 @@ const PostShareConnection = ( { connection, isActive, onToggle } ) => {
'is-broken': status === 'broken',
} );

const id = `post-share__label-${ keyring_connection_ID }`;
const id = `post-share__label-${ ID }`;

const accountImageStyle = {};
if ( external_profile_picture ) {
Expand Down
2 changes: 1 addition & 1 deletion client/blocks/post-share/connections-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ConnectionsList extends PureComponent {
<div className="post-share__connections">
{ connections.map( ( connection ) => (
<Connection
key={ connection.keyring_connection_ID }
key={ connection.ID }
{ ...{
connection,
onToggle,
Expand Down
12 changes: 6 additions & 6 deletions client/blocks/post-share/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ class PostShare extends Component {
this.setState( { scheduledDate: date } );
};

skipConnection( { keyring_connection_ID } ) {
return this.state.skipped.indexOf( keyring_connection_ID ) === -1;
skipConnection( { ID } ) {
return this.state.skipped.indexOf( ID ) === -1;
}

isConnectionActive = ( connection ) =>
Expand Down Expand Up @@ -173,7 +173,7 @@ class PostShare extends Component {
sharePost = () => {
const { postId, siteId, connections, isJetpack } = this.props;
const servicesToPublish = connections.filter(
( connection ) => this.state.skipped.indexOf( connection.keyring_connection_ID ) === -1
( connection ) => this.state.skipped.indexOf( connection.ID ) === -1
);
//Let's prepare array of service stats for tracks.
const numberOfAccountsPerService = servicesToPublish.reduce(
Expand Down Expand Up @@ -376,7 +376,7 @@ class PostShare extends Component {
<div>
{ brokenConnections.map( ( connection ) => (
<Notice
key={ connection.keyring_connection_ID }
key={ connection.ID }
status="is-warning"
showDismiss={ false }
text={ translate( 'There is an issue connecting to %s.', { args: connection.label } ) }
Expand All @@ -388,13 +388,13 @@ class PostShare extends Component {
) ) }
{ invalidConnections.map( ( connection ) => (
<Notice
key={ connection.keyring_connection_ID }
key={ connection.ID }
status="is-error"
showDismiss={ false }
text={
connection.service === 'facebook'
? translate( 'Connections to Facebook profiles ceased to work on August 1st.' )
: translate( 'Connections to %s have a permenant issue which prevents sharing.', {
: translate( 'Connections to %s have a permanent issue which prevents sharing.', {
args: connection.label,
} )
}
Expand Down
Loading