From aafd7ed21fcf6652b27a1de0b600d57b5d57bc8c Mon Sep 17 00:00:00 2001 From: triphora Date: Sun, 20 Nov 2022 15:43:01 -0500 Subject: [PATCH] Add feature flag for opening external links in a new tab (#749) Closes https://github.com/modrinth/knossos/issues/438 --- components/ui/Modal.vue | 2 +- layouts/default.vue | 22 +++++++++++----------- middleware/analytics.js | 2 +- nuxt.config.js | 1 + pages/_type/_id.vue | 33 ++++++++++++++++++--------------- pages/about.vue | 22 +++++++++++++--------- pages/index.vue | 16 ++++++++++------ pages/search.vue | 20 +++++++++++--------- pages/settings/index.vue | 23 +++++++++++++++++++++++ pages/user/_id.vue | 2 +- plugins/shorthands.js | 4 ++++ store/cosmetics.js | 8 ++++++++ 12 files changed, 102 insertions(+), 53 deletions(-) diff --git a/components/ui/Modal.vue b/components/ui/Modal.vue index 76af85eab..f27cdb036 100644 --- a/components/ui/Modal.vue +++ b/components/ui/Modal.vue @@ -3,7 +3,7 @@ diff --git a/middleware/analytics.js b/middleware/analytics.js index 4bb4fea87..fed71cc48 100644 --- a/middleware/analytics.js +++ b/middleware/analytics.js @@ -11,7 +11,7 @@ export default function (context) { return } - if (context.$config.analytics.base_url == null) { + if (process.env.NODE_ENV !== 'production') { return } diff --git a/nuxt.config.js b/nuxt.config.js index c81095f5d..c8bc06b62 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -375,6 +375,7 @@ export default { render: { routeDone(url, result, context) { setTimeout(() => { + if (process.env.NODE_ENV !== 'production') return axios .post( `${process.env.ARIADNE_URL || STAGING_ARIADNE_URL}view`, diff --git a/pages/_type/_id.vue b/pages/_type/_id.vue index f3290f4e2..aa367a973 100644 --- a/pages/_type/_id.vue +++ b/pages/_type/_id.vue @@ -8,7 +8,7 @@