Skip to content

Commit

Permalink
[TODO REMOVE, JUST FOR QA] Show storage banners
Browse files Browse the repository at this point in the history
  • Loading branch information
MisRob committed Jul 23, 2024
1 parent c1d662e commit 6a573c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions kolibri/core/assets/src/views/CorePage/AppBarPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

<script>
import { LearnerDeviceStatus } from 'kolibri.coreVue.vuex.constants';
import { mapGetters } from 'vuex';
import { throttle } from 'frame-throttle';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
Expand All @@ -72,6 +73,7 @@
mixins: [commonCoreStrings],
setup() {
const userDeviceStatus = useUserSyncStatus().deviceStatus;
userDeviceStatus.value = LearnerDeviceStatus.INSUFFICIENT_STORAGE;
const { windowBreakpoint, windowIsSmall } = useKResponsiveWindow();
return {
userDeviceStatus,
Expand Down
11 changes: 7 additions & 4 deletions kolibri/plugins/learn/assets/src/views/StorageNotification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
},
data() {
return {
testTimeoutIsDone: false,
bannerOpened: false,
};
},
Expand All @@ -129,6 +130,10 @@
} else if (this.availableDownload) {
message = this.$tr('insufficientStorageAvailableDownloads');
}
if (this.testTimeoutIsDone) {
message =
'Updated storage notification banner message that should be announced by screen readers.';
}
return message;
},
insufficientStorageNoDownloads() {
Expand All @@ -147,10 +152,7 @@
return !this.canManageContent && this.hasDownloads && !this.isLearner;
},
showBanner() {
return (
(this.insufficientStorage && this.local_storage_last_synced < this.lastSynced) ||
this.local_storage_lastDownloadRemoved < this.lastDownloadRemoved
);
return this.insufficientStorage;
},
},
watch: {
Expand All @@ -174,6 +176,7 @@
},
mounted() {
document.addEventListener('focusin', this.focusChange);
setTimeout(() => (this.testTimeoutIsDone = true), 15000);
},
beforeDestroy() {
document.removeEventListener('focusin', this.focusChange);
Expand Down

0 comments on commit 6a573c8

Please sign in to comment.