2018-02-01 12:17:04 +00:00
|
|
|
const getters = {
|
2019-01-05 16:12:09 +00:00
|
|
|
isLogged: state => state.user !== null,
|
|
|
|
isFiles: state => !state.loading && state.route.name === 'Files',
|
|
|
|
isListing: (state, getters) => getters.isFiles && state.req.isDir,
|
2020-07-07 19:41:13 +00:00
|
|
|
selectedCount: state => state.selected.length,
|
|
|
|
progress : state => {
|
2020-07-08 14:12:33 +00:00
|
|
|
if (state.upload.progress.length == 0) {
|
2020-07-07 19:41:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-07-08 14:12:33 +00:00
|
|
|
let sum = state.upload.progress.reduce((acc, val) => acc + val)
|
|
|
|
return Math.ceil(sum / state.upload.size * 100);
|
2020-07-07 19:41:13 +00:00
|
|
|
}
|
2018-02-01 12:17:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default getters
|