diff --git a/apps/remix-ide/src/app/plugins/file-decorator.ts b/apps/remix-ide/src/app/plugins/file-decorator.ts index f0287205f4..60a14ef47f 100644 --- a/apps/remix-ide/src/app/plugins/file-decorator.ts +++ b/apps/remix-ide/src/app/plugins/file-decorator.ts @@ -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' } @@ -46,10 +46,15 @@ export class FileDecorator extends Plugin { return index == -1 }) const newState = [...filteredState, ...fileStatesPayload].sort(sortByPath) - + if (!deepequal(newState, this._fileStates)) { this._fileStates = newState this.emit('fileDecoratorsChanged', this._fileStates) } } + + async clearFileDecorators() { + this._fileStates = [] + this.emit('fileDecoratorsChanged', []) + } } \ No newline at end of file diff --git a/apps/remix-ide/src/app/plugins/parser/code-parser.tsx b/apps/remix-ide/src/app/plugins/parser/code-parser.tsx index 9535ca2f68..a7ce1d57ce 100644 --- a/apps/remix-ide/src/app/plugins/parser/code-parser.tsx +++ b/apps/remix-ide/src/app/plugins/parser/code-parser.tsx @@ -114,7 +114,7 @@ export class CodeParser extends Plugin { }) this.on('filePanel', 'setWorkspace', async () => { - await this.call('fileDecorator', 'setFileDecorators', []) + await this.call('fileDecorator', 'clearFileDecorators') })