Skip to content

Commit

Permalink
Merge pull request #92 from RyotaUshio/master
Browse files Browse the repository at this point in the history
Add an optional chaining
  • Loading branch information
sissilab committed Nov 14, 2023
2 parents 12c7a35 + bf91909 commit b0fb33d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class ImageToolkitPlugin extends Plugin {
this.app.workspace.iterateAllLeaves((leaf: WorkspaceLeaf) => {
if (['markdown', 'image'].includes(leaf.getViewState()?.type)) {
const bodyEl = leaf.view.containerEl.matchParent('body');
if (bodyEl.hasClass('is-popout-window')) {
if (bodyEl?.hasClass('is-popout-window')) {
if (!bodyEl.hasAttribute(ImageToolkitPlugin.POPOUT_WINDOW_EVENT)) {
console.log('popout leaf:', leaf, leaf.getDisplayText());
const eventId = randomUUID();
Expand Down

0 comments on commit b0fb33d

Please sign in to comment.