diff --git a/CHANGELOG.md b/CHANGELOG.md index 47a30f086..296a73e68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ [#1582](https://github.com/nextcloud/cookbook/pull/1582) @roliverio - Make time input fields wider to view multiple digits in chrome [#1687](https://github.com/nextcloud/cookbook/pull/1687) @christianlupus +- Prevent popup from falsely showing during loading of the app + [#1764](https://github.com/nextcloud/cookbook/pull/1764) @christianlupus ### Maintenance - Fix URL of Transifex after upstream subdomain change diff --git a/src/components/SettingsDialog.vue b/src/components/SettingsDialog.vue index 13c01e19f..402b80a05 100644 --- a/src/components/SettingsDialog.vue +++ b/src/components/SettingsDialog.vue @@ -89,10 +89,8 @@
{{ - t( - "cookbook", - "Control which blocks of information are shown in the recipe view. If you do not use some features and find them distracting, you may hide them.", - ) + // prettier-ignore + t("cookbook", "Control which blocks of information are shown in the recipe view. If you do not use some features and find them distracting, you may hide them.") }}
+ + + {{ + // prettier-ignore + t("cookbook", "This allows to temporarily enable logging in the browser console in case of problems. You will not need these settings by default.") + }} + + Enable debugging + @@ -174,6 +185,8 @@ import ReloadIcon from "icons/Cached.vue" import api from "cookbook/js/api-interface" import { showSimpleAlertModal } from "cookbook/js/modals" +import { enableLogging } from "cookbook/js/logging" + export const SHOW_SETTINGS_EVENT = "show-settings" const INFO_BLOCK_KEYS = [ @@ -390,6 +403,9 @@ export default { this.$log.error("Library reindexing failed!") }) }, + enableLogger() { + enableLogging() + }, beforeDestroy() { unsubscribe(SHOW_SETTINGS_EVENT, this.handleShowSettings) diff --git a/src/js/api-interface.js b/src/js/api-interface.js index d8723328e..ecaa1b98f 100644 --- a/src/js/api-interface.js +++ b/src/js/api-interface.js @@ -13,8 +13,11 @@ instance.interceptors.request.use((config) => { `[axios] Making "${config.method}" request to "${config.url}"`, config, ) - const contentType = config.headers[config.method]["Content-Type"] - if (!["application/json", "text/json"].includes(contentType)) { + const contentType = config.headers["Content-Type"] + if ( + contentType && + !["application/json", "text/json"].includes(contentType) + ) { Vue.$log.warn( `[axios] Request to "${config.url}" is using Content-Type "${contentType}", not JSON`, ) diff --git a/src/js/logging.js b/src/js/logging.js index 07320e69e..a99d90618 100644 --- a/src/js/logging.js +++ b/src/js/logging.js @@ -66,3 +66,7 @@ export default function setupLogging(Vue) { Vue.$log.info(`Setting up logging with log level ${logLevel}`) } + +export function enableLogging() { + localStorage.setItem(KEY_ENABLED, true) +}