Created
February 17, 2022 13:57
-
-
Save xavxyz/34b5161a28fec1a193965668d07d93b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cersei/src/ui/App.vue b/cersei/src/ui/App.vue | |
index ad86133f..a0909502 100644 | |
--- a/cersei/src/ui/App.vue | |
+++ b/cersei/src/ui/App.vue | |
@@ -18,16 +18,14 @@ v-app#app.application--light.frk-normalizer( | |
router-view | |
</template> | |
-<script lang="ts"> | |
-import Vue from 'vue'; | |
- | |
+<script> | |
import FrkVersionUpgrader from '@frk/commons/ui/components/FrkVersionUpgrader.vue'; | |
import UserNotificationsContainer from '@frk/commons/ui/components/UserNotificationsContainer.vue'; | |
import loggedUser from '&cersei/ui/mixins/loggedUser'; | |
import FrkSidebar from '&cersei/ui/components/FrkSidebar.vue'; | |
-export default Vue.extend({ | |
+export default { | |
components: { | |
FrkSidebar, | |
FrkVersionUpgrader, | |
@@ -38,11 +36,11 @@ export default Vue.extend({ | |
}, | |
mixins: [loggedUser], | |
computed: { | |
- isTyrionRenderingApp(): boolean { | |
+ isTyrionRenderingApp() { | |
return this.$route.meta.appRenderedByTyrion && this.isRequestFromTyrion(); | |
}, | |
}, | |
-}); | |
+}; | |
</script> | |
<style lang="scss" scoped> | |
diff --git a/cersei/src/ui/plugins/tyrion.ts b/cersei/src/ui/plugins/tyrion.js | |
similarity index 58% | |
rename from cersei/src/ui/plugins/tyrion.ts | |
rename to cersei/src/ui/plugins/tyrion.js | |
index 0c656423..9777b0b9 100644 | |
--- a/cersei/src/ui/plugins/tyrion.ts | |
+++ b/cersei/src/ui/plugins/tyrion.js | |
@@ -1,18 +1,11 @@ | |
-import _Vue from 'vue'; | |
- | |
-declare module 'vue/types/vue' { | |
- interface Vue { | |
- tyrionHost: string; | |
- isRequestFromTyrion: () => boolean; | |
- } | |
-} | |
- | |
export default { | |
- install: (Vue: typeof _Vue) => { | |
+ install: Vue => { | |
const [tyrionHost] = process.env.VUE_APP_API_URL.split('/graphql'); | |
+ // eslint-disable-next-line | |
Vue.prototype.tyrionHost = tyrionHost; | |
+ // eslint-disable-next-line | |
Vue.prototype.isRequestFromTyrion = function () { | |
return document.referrer.includes(tyrionHost); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment