clear the decorators

pull/5370/head
filip mertens 2 years ago
parent b6ac0d93d9
commit 3f6c5d73c7
  1. 7
      apps/remix-ide/src/app/plugins/file-decorator.ts
  2. 2
      apps/remix-ide/src/app/plugins/parser/code-parser.tsx

@ -8,7 +8,7 @@ import { fileDecoration } from '@remix-ui/file-decorators'
const profile = {
name: 'fileDecorator',
desciption: 'Keeps decorators of the files',
methods: ['setFileDecorators'],
methods: ['setFileDecorators', 'clearFileDecorators'],
events: ['fileDecoratorsChanged'],
version: '0.0.1'
}
@ -52,4 +52,9 @@ export class FileDecorator extends Plugin {
this.emit('fileDecoratorsChanged', this._fileStates)
}
}
async clearFileDecorators() {
this._fileStates = []
this.emit('fileDecoratorsChanged', [])
}
}

@ -114,7 +114,7 @@ export class CodeParser extends Plugin {
})
this.on('filePanel', 'setWorkspace', async () => {
await this.call('fileDecorator', 'setFileDecorators', [])
await this.call('fileDecorator', 'clearFileDecorators')
})

Loading…
Cancel
Save