From 8984adde25ec7706853a8d4734e62f06f73a5ebe Mon Sep 17 00:00:00 2001 From: Allan Otodi Opeto <103313919+AllanOXDi@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:31:12 +0300 Subject: [PATCH 1/3] replaced isEmbeddedWebView with isAppContext from a userUser composable --- kolibri/core/assets/src/composables/useUser.js | 2 ++ kolibri/core/assets/src/utils/browserInfo.js | 2 +- .../src/views/ContentRenderer/DownloadButton.vue | 11 +++++++++-- .../assets/src/views/reports/ReportsControls.vue | 11 +++++++++-- .../device/assets/src/modules/deviceInfo/handlers.js | 4 ++-- .../facility/assets/src/views/DataPage/index.vue | 8 ++++++-- 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/kolibri/core/assets/src/composables/useUser.js b/kolibri/core/assets/src/composables/useUser.js index 479f2ae81df..a61c4841b4b 100644 --- a/kolibri/core/assets/src/composables/useUser.js +++ b/kolibri/core/assets/src/composables/useUser.js @@ -9,6 +9,7 @@ export default function useUser() { const isAdmin = computed(() => store.getters.isAdmin); const isSuperuser = computed(() => store.getters.isSuperuser); const canManageContent = computed(() => store.getters.canManageContent); + const isAppContext = computed(() => store.getters.isAppContext); return { isLearnerOnlyImport, @@ -18,5 +19,6 @@ export default function useUser() { isAdmin, isSuperuser, canManageContent, + isAppContext, }; } diff --git a/kolibri/core/assets/src/utils/browserInfo.js b/kolibri/core/assets/src/utils/browserInfo.js index 412b0d92498..af402ce36d7 100644 --- a/kolibri/core/assets/src/utils/browserInfo.js +++ b/kolibri/core/assets/src/utils/browserInfo.js @@ -86,7 +86,7 @@ export const isMacWebView = /** * All web views */ -export const isEmbeddedWebView = isAndroidWebView || isMacWebView; +export const isAppContext = isAndroidWebView || isMacWebView; // Check for presence of the touch event in DOM or multi-touch capabilities export const isTouchDevice = diff --git a/kolibri/core/assets/src/views/ContentRenderer/DownloadButton.vue b/kolibri/core/assets/src/views/ContentRenderer/DownloadButton.vue index 7429efb3e5a..0bc460e0e61 100644 --- a/kolibri/core/assets/src/views/ContentRenderer/DownloadButton.vue +++ b/kolibri/core/assets/src/views/ContentRenderer/DownloadButton.vue @@ -20,12 +20,19 @@