|
|
|
@ -115,23 +115,26 @@ export class GistHandler extends Plugin { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const gistIdWorkspace = 'gist ' + gistId |
|
|
|
|
const workspaces = await this.call('filePanel', 'getWorkspaces') |
|
|
|
|
const found = workspaces.find((workspace) => workspace.name === gistIdWorkspace) |
|
|
|
|
if (found) {
|
|
|
|
|
await this.call('notification', 'alert', { |
|
|
|
|
id: 'gistAlert', |
|
|
|
|
message: `workspace "${gistIdWorkspace}" already exists`, |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
await this.call('filePanel', 'createWorkspace', 'gist ' + gistId, '', true) |
|
|
|
|
await this.call('filePanel', 'switchToWorkspace', { name: 'gist ' + gistId, isLocalHost: false }) |
|
|
|
|
//const workspaces = await this.call('filePanel', 'getWorkspaces')
|
|
|
|
|
//const found = workspaces.find((workspace) => workspace.name === gistIdWorkspace)
|
|
|
|
|
//if (found) {
|
|
|
|
|
// await this.call('notification', 'alert', {
|
|
|
|
|
// id: 'gistAlert',
|
|
|
|
|
// message: `workspace "${gistIdWorkspace}" already exists`,
|
|
|
|
|
// })
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
//await this.call('filePanel', 'createWorkspace', 'gist ' + gistId, '', true)
|
|
|
|
|
//await this.call('filePanel', 'switchToWorkspace', { name: 'gist ' + gistId, isLocalHost: false })
|
|
|
|
|
|
|
|
|
|
const obj: StringByString = {} |
|
|
|
|
Object.keys(data.files).forEach((element) => { |
|
|
|
|
const path = element.replace(/\.\.\./g, '/') |
|
|
|
|
obj['/' + path] = data.files[element] |
|
|
|
|
}) |
|
|
|
|
console.log(obj) |
|
|
|
|
await this.call('remix-templates', 'loadFilesInNewWindow', obj) |
|
|
|
|
/* |
|
|
|
|
this.call('fileManager', 'setBatchFiles', obj, isElectron()? 'electron':'workspace', true, async (errorSavingFiles: any) => { |
|
|
|
|
if (errorSavingFiles) { |
|
|
|
|
const modalContent = { |
|
|
|
@ -143,6 +146,7 @@ export class GistHandler extends Plugin { |
|
|
|
|
this.call('notification', 'alert', modalContent) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
*/ |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|