Skip to content

Commit

Permalink
fixes available storage bug
Browse files Browse the repository at this point in the history
  • Loading branch information
akolson committed Oct 13, 2023
1 parent 2a0c2da commit 7af2822
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<td
v-if="!loading"
>
{{ formattedSize(availableSpace) }}
{{ formattedSize(availableStorage) }}
</td>
</tr>
</table>
Expand Down Expand Up @@ -58,6 +58,7 @@
import { computed, getCurrentInstance } from 'kolibri.lib.vueCompositionApi';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import plugin_data from 'plugin_data';
import useDownloadRequests from '../../composables/useDownloadRequests';
import useDevices from '../../composables/useDevices';
import DownloadsList from './DownloadsList';
Expand Down Expand Up @@ -90,17 +91,26 @@
const sort = computed(() => query.value.sort);
const availableStorage = computed(() => {
let space = get(availableSpace);
if (plugin_data.setLimitForAutodownload) {
space = Math.min(space, plugin_data.limitForAutodownload);
}
return space;
});
fetchAvailableFreespace();
pollUserDownloadRequests();
return {
downloadRequestMap,
loading,
availableSpace,
fetchDownloads: fetchUserDownloadRequests,
fetchAvailableFreespace,
fetchDevices,
sort,
removeDownloadRequest,
availableStorage,
};
},
computed: {
Expand Down

0 comments on commit 7af2822

Please sign in to comment.