Skip to content

Commit

Permalink
fix slow first start
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamfliper committed Mar 20, 2017
1 parent 0a1e61f commit 116cbee
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/src/renderer/components/LandingPageView/Contentvue.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<modal title="Content Preview" transition="slideUp" :is-show="getshowmodal" :width="viewwidth" @close="TOGGLE_SHOWMODAL">
<h4>{{getFileName}}</h4>
<h4>{{validate()}}</h4>
<pre class="has-text-left">{{translatedcontent()}}</pre>
</modal>
</template>
Expand Down Expand Up @@ -28,7 +28,18 @@ import OpenCC from 'opencc'
translatedcontent(){
let tmode = this.getpflag ? this.getMode+'p':this.getMode
let opencc = new OpenCC(tmode+".json")
return opencc.convertSync(this.getContent)
try{
return opencc.convertSync(this.getContent)
}catch(err){
console.log(err)
}
},
validate(){
try{
getFileName
}catch(err){
console.log(err)
}
},
...mapMutations([
'DECREMENT_MAIN_COUNTER',
Expand Down

0 comments on commit 116cbee

Please sign in to comment.