Commit 83830ba 1 parent ed94afa commit 83830ba Copy full SHA for 83830ba
File tree 5 files changed +33
-24
lines changed
5 files changed +33
-24
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,12 @@ app.on('window-all-closed', () => {
106
106
} )
107
107
108
108
app . on ( 'activate' , ( e , hasVisibleWindows ) => {
109
+ // If the application is not ready, then
110
+ // just return and wait when the app is ready.
111
+ if ( ! app . isReady ( ) ) {
112
+ return
113
+ }
114
+
109
115
if ( mainWindow == null ) {
110
116
mainWindow = createMainWindow ( )
111
117
if ( platform === 'darwin' ) {
Original file line number Diff line number Diff line change 87
87
"pify" : " ^2.3.0" ,
88
88
"sanitize-html" : " ^1.13.0" ,
89
89
"sumchecker" : " ^2.0.1" ,
90
- "unique-random-array" : " ^1 .0.0" ,
90
+ "unique-random-array" : " ^2 .0.0" ,
91
91
"vuex" : " ^2.1.1"
92
92
}
93
93
}
Original file line number Diff line number Diff line change 32
32
</div >
33
33
</template >
34
34
35
- <script >
36
- import random from ' unique-random-array'
37
- import tips from ' utils/tips'
35
+ <script lang="ts">
36
+ import tips from " utils/tips" ;
37
+ import uniqueRandomArray from " unique-random-array" ;
38
+ import Vue from " vue" ;
38
39
39
- const randomTip = random (tips)
40
+ const randomTips = uniqueRandomArray (tips );
40
41
41
- export default {
42
- data () {
42
+ export default Vue . extend ( {
43
+ data : function () {
43
44
return {
44
- tip: randomTip ()
45
- }
45
+ tip: randomTips (),
46
+ interval: 0
47
+ };
46
48
},
47
49
mounted() {
48
- this .interval = setInterval (() => {
49
- this .tip = randomTip ()
50
- }, 20000 )
50
+ this .interval = window . setInterval (() => {
51
+ this .tip = randomTips ();
52
+ }, 20000 );
51
53
},
52
54
beforeDestroy() {
53
- clearInterval (this .interval )
54
- this .interval = null
55
+ clearInterval (this .interval );
55
56
}
56
- }
57
+ });
58
+
57
59
</script >
Original file line number Diff line number Diff line change 2
2
"compilerOptions" : {
3
3
"outDir" : "./dist/" ,
4
4
"allowJs" : true ,
5
+ "allowSyntheticDefaultImports" : true ,
5
6
"sourceMap" : true ,
6
7
"strict" : true ,
7
8
"noImplicitReturns" : true ,
Original file line number Diff line number Diff line change @@ -7727,17 +7727,17 @@ uniqs@^2.0.0:
7727
7727
resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02"
7728
7728
integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI=
7729
7729
7730
- unique-random-array@^1 .0.0 :
7731
- version "1 .0.1 "
7732
- resolved "https://registry.yarnpkg.com/unique-random-array/-/unique-random-array-1 .0.1 .tgz#f29bda2a62be8860a703c4739c8f4fdb4d722cc7 "
7733
- integrity sha512-z9J/SV8CUIhIRROcHe9YUoAT6XthUJt0oUyLGgobiXJprDP9O9dsErNevvSaAv5BkhwFEVPn6nIEOKeNE6Ck1Q ==
7730
+ unique-random-array@^2 .0.0 :
7731
+ version "2 .0.0 "
7732
+ resolved "https://registry.yarnpkg.com/unique-random-array/-/unique-random-array-2 .0.0 .tgz#9e639b1a9dc141e97350a6fc6f17da4b0717b1ad "
7733
+ integrity sha512-xR87O95fZ7hljw84J8r1YDXrvffPLWN513BNOP4Bv0KcgG5dyEUrHwsvP7mVAOKg4Y80uqRbpUk0GKr8il70qg ==
7734
7734
dependencies :
7735
- unique-random "^1.0 .0"
7735
+ unique-random "^2.1 .0"
7736
7736
7737
- unique-random@^1.0 .0 :
7738
- version "1.0 .0"
7739
- resolved "https://registry.yarnpkg.com/unique-random/-/unique-random-1.0.0. tgz#ce3e224c8242cd33a0e77b0d7180d77e6b62d0c4 "
7740
- integrity sha1-zj4iTIJCzTOg53sNcYDXfmti0MQ =
7737
+ unique-random@^2.1 .0 :
7738
+ version "2.1 .0"
7739
+ resolved "https://registry.yarnpkg.com/unique-random/-/unique-random-2. 1.0.tgz#7a8413da5176d028567168b57125ac5c0cec5c25 "
7740
+ integrity sha512-iQ1ZgWac3b8YxGThecQFRQiqgk6xFERRwHZIWeVVsqlbmgCRl0PY13R4mUkodNgctmg5b5odG1nyW/IbOxQTqg= =
7741
7741
7742
7742
unique-string@^2.0.0 :
7743
7743
version "2.0.0"
You can’t perform that action at this time.
0 commit comments