From 278bcdf4f7a05dfa57f88eb8d6b0615602782eeb Mon Sep 17 00:00:00 2001 From: Tony Arcangelini Date: Mon, 30 Nov 2026 22:10:40 +0100 Subject: [PATCH] CM-1061: build Howdy-Stage: build --- .../changelog/cm-1061-comment-form-shows-the-subscribe-switch | 4 ++++ projects/packages/comments/src/modal/index.tsx | 3 +++ projects/packages/comments/src/shared/checkpoint.ts | 1 + projects/packages/comments/src/shared/types.ts | 4 +++- 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 projects/packages/comments/changelog/cm-1061-comment-form-shows-the-subscribe-switch diff --git a/projects/packages/comments/changelog/cm-1061-comment-form-shows-the-subscribe-switch b/projects/packages/comments/changelog/cm-1061-comment-form-shows-the-subscribe-switch new file mode 100644 index 000000000000..f695f6901030 --- /dev/null +++ b/projects/packages/comments/changelog/cm-1061-comment-form-shows-the-subscribe-switch @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Turn the site subscription switch on after a WordPress.com sign-in when the account already subscribes. diff --git a/projects/packages/comments/src/modal/index.tsx b/projects/packages/comments/src/modal/index.tsx index 682663cc5cf6..50c51784fccf 100644 --- a/projects/packages/comments/src/modal/index.tsx +++ b/projects/packages/comments/src/modal/index.tsx @@ -207,6 +207,9 @@ export const Dialog = ( { internals }: { internals: ElementInternals } ) => { } if ( formSettings.subscriptions.length ) { + if ( result.subscribedBlog ) { + setSubscribed( current => ( { ...current, subscribe_blog: true } ) ); + } setStep( 'subscribe' ); return; } diff --git a/projects/packages/comments/src/shared/checkpoint.ts b/projects/packages/comments/src/shared/checkpoint.ts index 77f2318a7203..e32ab180aed8 100644 --- a/projects/packages/comments/src/shared/checkpoint.ts +++ b/projects/packages/comments/src/shared/checkpoint.ts @@ -93,6 +93,7 @@ export const signIn = async ( code: data.code, name: typeof data.name === 'string' ? data.name : '', avatar: ( typeof data.avatar === 'string' && data.avatar ) || identity.defaultAvatar, + subscribedBlog: data.subscribed_blog === true, } ); } diff --git a/projects/packages/comments/src/shared/types.ts b/projects/packages/comments/src/shared/types.ts index 269defa4fc25..ec040e4d0013 100644 --- a/projects/packages/comments/src/shared/types.ts +++ b/projects/packages/comments/src/shared/types.ts @@ -18,7 +18,9 @@ export type Passport = { }; export type CheckpointResult = - ( Passport & { code: string } ) | { error: string } | { cancelled: true }; + | ( Passport & { code: string; subscribedBlog: boolean } ) + | { error: string } + | { cancelled: true }; /** * Who is commenting. A popup sign-in's `code` is set until the comment posts and