Skip to content

Commit

Permalink
feat(react-tinacms-github): GithubMediaStore implements previewSrc
Browse files Browse the repository at this point in the history
  • Loading branch information
ncphillips committed Aug 13, 2020
1 parent e4024d2 commit 325fdb4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/react-tinacms-github/src/github-media-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,12 @@ export class GithubMediaStore implements MediaStore {

return uploaded
}

async previewSrc(src: string) {
try {
return this.githubClient.getDownloadUrl(src)
} catch {
return src
}
}
}

0 comments on commit 325fdb4

Please sign in to comment.