Skip to content

Commit 726137d

Browse files
Fix TS error (#41200)
1 parent ca6c8b1 commit 726137d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: fixed
3+
Comment: Fixes a TS error in trunk following a PR merged
4+
5+

projects/js-packages/publicize-components/src/social-store/selectors/connection-data.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,11 @@ export const canUserManageConnection = createRegistrySelector(
249249
return true;
250250
}
251251

252-
const {
253-
// @ts-expect-error getUser exists but `core-data` entities are not typed properly.
254-
// Should work fine after https://github.com/WordPress/gutenberg/pull/67668 is released to npm.
255-
getUser,
256-
} = select( coreStore );
252+
const { getUser } = select( coreStore );
257253

258254
// The user has to be at least an editor to manage the connection.
255+
// @ts-expect-error User object types are wrong, capabilities are boolean, not string.
256+
// See https://github.com/WordPress/gutenberg/pull/68045
259257
return getUser( current_user.id )?.capabilities?.edit_others_posts ?? false;
260258
}
261259
);

0 commit comments

Comments
 (0)