remove redundancies

pull/3475/head
Joseph Izang 2 years ago committed by Aniket
parent 7146254d3a
commit affa294efb
  1. 1
      apps/docviewer/src/app/App.tsx
  2. 17
      apps/docviewer/src/app/docviewer.ts

@ -7,7 +7,6 @@ export default function App() {
const [contents, setContents] = useState('')
useEffect(() => {
client.eventEmitter.on('contentsReady', (fileContents: string) => {
console.log('contentsReady', fileContents)
setContents(fileContents)
})

@ -4,7 +4,6 @@ import EventEmitter from 'events'
export class DocViewer extends PluginClient {
mdFile: string
fileContents: string
eventEmitter: EventEmitter
constructor() {
super()
@ -15,25 +14,9 @@ export class DocViewer extends PluginClient {
this.onload()
}
async setProperties() {
console.log('inside setProperties')
this.on('docgen' as any, 'docsGenerated', async (docs: string[]) => {
console.log('docsGenerated', docs)
this.mdFile = docs[0]
const contents = await this.call('fileManager', 'readFile', this.mdFile)
console.log({ contents })
this.fileContents = contents
this.eventEmitter.emit('docviewer', 'contentsReady', this.fileContents)
})
}
async viewDocs(docs: string[]) {
console.log('viewDocs', docs)
console.log('docsGenerated', docs)
this.mdFile = docs[0]
const contents = await this.call('fileManager', 'readFile', this.mdFile)
console.log({ contents })
this.fileContents = contents
this.eventEmitter.emit('contentsReady', contents)
}
}
Loading…
Cancel
Save