Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
[Workaround] Work around for Atom bug #16801
Browse files Browse the repository at this point in the history
  • Loading branch information
lierdakil committed Feb 21, 2018
1 parent 9d029af commit d1f7492
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/markdown-preview-view.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/markdown-preview-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,11 @@ export class MarkdownPreviewView {
}
}

const htmlFilePath = atom.showSaveDialogSync(filePath)
const htmlFilePath =
atom.getVersion() === '1.24.0'
? // tslint:disable-next-line:no-unsafe-any // TODO: remove this once Atom is fixed
((atom as any).applicationDelegate.showSaveDialog(filePath) as string)
: atom.showSaveDialogSync(filePath)
if (htmlFilePath) {
return this.getHTML((error: Error | null, htmlBody: string) => {
if (error !== null) {
Expand Down

2 comments on commit d1f7492

@winstliu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would start looking into refactoring this codepath to move away from atom.showSaveDialogSync(), since you will start receiving deprecations on Atom 1.25. An example conversion can be seen at atom/markdown-preview#521.

@lierdakil
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, yes, I noticed that. Don't have time to dig into that right now.

Please sign in to comment.