Skip to content

Commit

Permalink
remember previously opened gist
Browse files Browse the repository at this point in the history
  • Loading branch information
blurymind committed Mar 23, 2024
1 parent 82a546b commit e15daa4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/js/classes/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,8 @@ export const data = {

tryOpenGist: function(gists) {
if (gists && gists.file && gists.file.length > 0) {
const previouslyOpenedGist =
data.lastStorageHost() === 'GIST' ? data.editingName() : '';
gists.get(gists.file).then(gist => {
const gistFiles = gist.body.files;
const inputOptions = {};
Expand All @@ -1212,6 +1214,7 @@ export const data = {
inputAttributes: {
autocomplete: 'off',
},
inputValue: previouslyOpenedGist,
inputPlaceholder: 'Select a file from the gist',
showCancelButton: true,
}).then(({ value }) => {
Expand Down

0 comments on commit e15daa4

Please sign in to comment.