feat: remove no longer needed isWarn property and injection key

This commit is contained in:
Sebin Nyshkim 2023-04-02 17:45:08 +02:00
parent cc664a764d
commit b8c9d8de17
5 changed files with 4 additions and 10 deletions

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, provide } from "vue"; import { ref, provide } from "vue";
import { RouterView } from "vue-router"; import { RouterView } from "vue-router";
import { isWarnKey, modalResultKey, nsfwKey, showModalKey } from "@/keys"; import { modalResultKey, nsfwKey, showModalKey } from "@/keys";
import RefModal from "@/components/RefModal.vue"; import RefModal from "@/components/RefModal.vue";
import ButtonGroup from "@/components/ButtonGroup.vue"; import ButtonGroup from "@/components/ButtonGroup.vue";
import Button from "@/components/RefButton.vue"; import Button from "@/components/RefButton.vue";
@ -14,7 +14,6 @@ const version = pkg.version;
const isNsfw = ref(false); const isNsfw = ref(false);
const isConfirmedHorny = ref(false); const isConfirmedHorny = ref(false);
const isWarn = ref(false);
const nsfwmodal = ref<InstanceType<typeof RefModal>>(); const nsfwmodal = ref<InstanceType<typeof RefModal>>();
@ -36,7 +35,6 @@ const modalResult = (value: boolean): void => {
nsfwmodal.value?.close(); nsfwmodal.value?.close();
}; };
provide(isWarnKey, isWarn);
provide(modalResultKey, modalResult); provide(modalResultKey, modalResult);
provide(nsfwKey, isNsfw); provide(nsfwKey, isNsfw);
provide(showModalKey, showModal); provide(showModalKey, showModal);

View file

@ -1,6 +1,5 @@
import type { InjectionKey, Ref } from "vue"; import type { InjectionKey, Ref } from "vue";
export const isWarnKey: InjectionKey<Ref<boolean>> = Symbol("isWarnKey");
export const nsfwKey: InjectionKey<Ref<boolean>> = Symbol("nsfwKey"); export const nsfwKey: InjectionKey<Ref<boolean>> = Symbol("nsfwKey");
export const showModalKey: InjectionKey<Function> = Symbol("showModalKey"); export const showModalKey: InjectionKey<Function> = Symbol("showModalKey");
export const modalResultKey: InjectionKey<Function> = Symbol("modalResultKey"); export const modalResultKey: InjectionKey<Function> = Symbol("modalResultKey");

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { inject } from "vue"; import { inject } from "vue";
import { isWarnKey, nsfwKey, showModalKey } from "@/keys"; import { nsfwKey, showModalKey } from "@/keys";
import type { ColorDict } from "@/interfaces"; import type { ColorDict } from "@/interfaces";
import { tailLength, wingspan, penis, colors } from "@/sebin"; import { tailLength, wingspan, penis, colors } from "@/sebin";
import { toImperial, toFahrenheit } from "@/helpers"; import { toImperial, toFahrenheit } from "@/helpers";
@ -33,7 +33,6 @@ const sebinPenisData = [
]; ];
const isNsfw = inject<boolean>(nsfwKey, false); const isNsfw = inject<boolean>(nsfwKey, false);
const isWarn = inject<boolean>(isWarnKey, false);
const showModal = inject<Function>(showModalKey, Function); const showModal = inject<Function>(showModalKey, Function);
</script> </script>

View file

@ -16,7 +16,7 @@ import {
kinks, kinks,
} from "@/sebin"; } from "@/sebin";
import { dateFormat, getAge, toImperial, toLbs } from "@/helpers"; import { dateFormat, getAge, toImperial, toLbs } from "@/helpers";
import { isWarnKey, nsfwKey, showModalKey } from "@/keys"; import { nsfwKey, showModalKey } from "@/keys";
import type { Kink } from "@/interfaces"; import type { Kink } from "@/interfaces";
import DataTable from "@/components/DataTable.vue"; import DataTable from "@/components/DataTable.vue";
import QuickFacts from "@/components/QuickFacts.vue"; import QuickFacts from "@/components/QuickFacts.vue";
@ -51,7 +51,6 @@ const kinksData = kinks.map((kink: Kink): string[] => {
}); });
const isNsfw = inject<boolean>(nsfwKey, false); const isNsfw = inject<boolean>(nsfwKey, false);
const isWarn = inject<boolean>(isWarnKey, false);
const showModal = inject<Function>(showModalKey, Function); const showModal = inject<Function>(showModalKey, Function);
</script> </script>

View file

@ -1,13 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { inject } from "vue"; import { inject } from "vue";
import { isWarnKey, nsfwKey, showModalKey } from "@/keys"; import { nsfwKey, showModalKey } from "@/keys";
import RefToggle from "@/components/RefToggle.vue"; import RefToggle from "@/components/RefToggle.vue";
import WelcomeHeader from "@/components/WelcomeHeader.vue"; import WelcomeHeader from "@/components/WelcomeHeader.vue";
import ButtonGroup from "@/components/ButtonGroup.vue"; import ButtonGroup from "@/components/ButtonGroup.vue";
import Button from "@/components/RefButton.vue"; import Button from "@/components/RefButton.vue";
const isNsfw = inject<boolean>(nsfwKey, false); const isNsfw = inject<boolean>(nsfwKey, false);
const isWarn = inject<boolean>(isWarnKey, false);
const showModal = inject<Function>(showModalKey, Function); const showModal = inject<Function>(showModalKey, Function);
</script> </script>