Skip to content

Commit

Permalink
fix delete plugin file
Browse files Browse the repository at this point in the history
  • Loading branch information
blurymind committed Aug 13, 2024
1 parent 5e9cb2d commit 0460050
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/js/classes/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ export const StorageJs = (type = 'gist') => {
'X-GitHub-Api-Version': '2022-11-28',
},
body: JSON.stringify({
description: 'upload data from api',
description: content ? 'upload data from api' : `delete ${fileName}`,
public: false,
files: { [fileName]: { content } },
files: { [fileName]: content ? {} :{ content } },
}),
}).then(res => {
this.setLastStorageHost('GIST');
Expand Down
2 changes: 1 addition & 1 deletion src/public/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export var Plugins = function (app) {

const deleteGistPlugin = (fileName) => {
//todo doesnt work
return app.data.storage.deleteGistFile(gistPluginsFileUrl || app.settings.gistPluginsFile(), fileName);
return app.data.storage.deleteGistFile(gistPluginsId || app.settings.gistPluginsFile(), fileName);
}


Expand Down
4 changes: 1 addition & 3 deletions src/public/plugins/plugin-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ export var PluginEditor = function ({
const nextFile = fileNames.length > 0 ? fileNames[0] : '';
deleteVolatilePlugin(this.editingFile).then(()=> {
deleteGistPlugin(this.editingFile).then(()=>{
this.onUpdatePluginsList(nextFile).then(err=>{
console.log({err})
this.onUpdatePluginsList(nextFile).then(() =>{
this.onSetEditingFile(nextFile)
alert("todo")
})
})
})
Expand Down

0 comments on commit 0460050

Please sign in to comment.