Skip to content

Commit 8fedd1a

Browse files
josephfuscoCopilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c3a20f5 commit 8fedd1a

File tree

1 file changed

+2
-1
lines changed
  • examples/next/toolbar-demo/example-app/app/components

1 file changed

+2
-1
lines changed

examples/next/toolbar-demo/example-app/app/components/Toolbar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export function Toolbar() {
7979
<button
8080
className="hwp-toolbar-button"
8181
onClick={() => {
82-
if (confirm(`Logged in as: ${state.user!.name}\n\nLogout?`)) {
82+
const user = state.user;
83+
if (user && confirm(`Logged in as: ${user.name}\n\nLogout?`)) {
8384
toolbar.setWordPressContext({
8485
user: null,
8586
post: null,

0 commit comments

Comments
 (0)