From 6823eeb92f8f5fbac808fd0d5758b9932ccaeec1 Mon Sep 17 00:00:00 2001 From: Sebin Nyshkim Date: Thu, 6 Jan 2022 04:30:57 +0100 Subject: [PATCH] refactor: :recycle: move nsfw functionality into root component --- src/App.vue | 10 ++++++++++ src/components/NsfwWarning.vue | 6 +++--- src/views/Anatomy.vue | 24 +++++------------------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9268ee1..96d683a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,6 +19,9 @@ export default { components: { Navigation }, data() { return { + nsfw: false, + isConfirmedHorny: false, + isWarn: false, routes: [ { path: "/", name: "Home" }, { path: "/general", name: "General" }, @@ -29,6 +32,13 @@ export default { ], }; }, + methods: { + showWarning() { + if (!this.isConfirmedHorny) { + this.isWarn = true; + } + }, + } }; diff --git a/src/components/NsfwWarning.vue b/src/components/NsfwWarning.vue index b018b5e..53bac3f 100644 --- a/src/components/NsfwWarning.vue +++ b/src/components/NsfwWarning.vue @@ -23,9 +23,9 @@ export default { methods: { confirmNsfw(input) { - this.$parent.nsfw = input; - this.$parent.isConfirmedHorny = input; - this.$parent.isWarn = false; + this.$root.nsfw = input; + this.$root.isConfirmedHorny = input; + this.$root.isWarn = false; }, }, }; diff --git a/src/views/Anatomy.vue b/src/views/Anatomy.vue index e6b860f..edbf7ce 100644 --- a/src/views/Anatomy.vue +++ b/src/views/Anatomy.vue @@ -1,5 +1,5 @@