1
1
<template >
2
2
<div >
3
3
<Hero title =" Downloads" subtitle =" Monitor progress of downloads" hero-type =" primary" />
4
- <template v-if =" activeDownloads .length === 0 " >
4
+ <template v-if =" $store . state . download . allDownloads .length === 0 " >
5
5
<div class =' text-center top' >
6
6
<div class =" margin-right" >
7
7
<br />
13
13
</div >
14
14
</template >
15
15
<template v-else >
16
- <div v-for =" (downloadObject, index) of activeDownloads " :key =" `download-progress-${index}`" >
16
+ <div v-for =" (downloadObject, index) of $store.getters['download/newestFirst'] " :key =" `download-progress-${index}`" >
17
17
<div >
18
18
<div class =" container margin-right" >
19
19
<div class =" border-at-bottom pad pad--sides" >
42
42
43
43
<script lang="ts">
44
44
45
- import Timeout = NodeJS .Timeout ;
46
45
import { Component , Vue } from ' vue-property-decorator' ;
47
46
48
47
import { Hero } from ' ../components/all' ;
49
48
import Progress from ' ../components/Progress.vue' ;
50
- import { DownloadProgress } from " ../store/modules/DownloadModule" ;
51
49
52
50
@Component ({
53
51
components: {
@@ -56,20 +54,6 @@ import { DownloadProgress } from "../store/modules/DownloadModule";
56
54
}
57
55
})
58
56
export default class DownloadMonitor extends Vue {
59
- private refreshInterval! : Timeout ;
60
- private activeDownloads: DownloadProgress [] = [];
61
-
62
- created() {
63
- this .activeDownloads = [... this .$store .state .download .allDownloads ].reverse ();
64
- this .refreshInterval = setInterval (() => {
65
- this .activeDownloads = [... this .$store .state .download .allDownloads ].reverse ();
66
- }, 100 );
67
- }
68
-
69
- destroyed() {
70
- clearInterval (this .refreshInterval );
71
- }
72
-
73
57
}
74
58
75
59
</script >
0 commit comments