refactor: use refAutoReset instead of settimeout (#2385)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Liyas Thomas
2022-06-01 16:54:37 +05:30
committed by GitHub
parent 39f72f8458
commit cf90d16f8a
18 changed files with 62 additions and 53 deletions

View File

@@ -236,6 +236,7 @@
<script setup lang="ts">
import { ref, computed, watch, defineComponent } from "@nuxtjs/composition-api"
import { refAutoReset } from "@vueuse/core"
import { applySetting, toggleSetting, useSetting } from "~/newstore/settings"
import {
useToast,
@@ -276,7 +277,7 @@ const hasFirefoxExtInstalled = computed(
() => browserIsFirefox() && currentExtensionStatus.value === "available"
)
const clearIcon = ref("rotate-ccw")
const clearIcon = refAutoReset<"rotate-ccw" | "check">("rotate-ccw", 1000)
const confirmRemove = ref(false)
@@ -322,7 +323,6 @@ const resetProxy = () => {
applySetting("PROXY_URL", `https://proxy.hoppscotch.io/`)
clearIcon.value = "check"
toast.success(`${t("state.cleared")}`)
setTimeout(() => (clearIcon.value = "rotate-ccw"), 1000)
}
const getColorModeName = (colorMode: string) => {