From 2f9eabc3db4341d49398b634b4dbdd6feb5430d1 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 29 Jul 2022 19:54:33 +0200 Subject: [PATCH] Remove unused logs page --- src/components/pages/Settings.vue | 8 -------- src/use/logs.js | 27 --------------------------- 2 files changed, 35 deletions(-) delete mode 100644 src/use/logs.js diff --git a/src/components/pages/Settings.vue b/src/components/pages/Settings.vue index 98d4298..49b7ad9 100644 --- a/src/components/pages/Settings.vue +++ b/src/components/pages/Settings.vue @@ -748,18 +748,12 @@ import { copyToClipboard } from '@/utils/utils' import BaseAccordion from '@/components/globals/BaseAccordion.vue' import { fetchData, postToServer } from '@/utils/api' import { getFormItem } from '@/utils/forms' -import { useLogs } from '@/use/logs' export default { components: { BaseAccordion, TemplateVariablesList }, - setup() { - const { areLogsActive, saveLogsSettings } = useLogs() - - return { areLogsActive, saveLogsSettings } - }, data() { return { flags, @@ -925,8 +919,6 @@ export default { localStorage.setItem('locale', newLocale) }, saveSettings() { - this.saveLogsSettings() - this.lastSettings = JSON.parse(JSON.stringify(this.settings)) this.lastCredentials = JSON.parse(JSON.stringify(this.spotifyFeatures)) diff --git a/src/use/logs.js b/src/use/logs.js deleted file mode 100644 index 80efadb..0000000 --- a/src/use/logs.js +++ /dev/null @@ -1,27 +0,0 @@ -import { ref } from '@vue/composition-api' -import { socket } from '@/utils/socket' - -const messages = ref([]) -const cached = localStorage.getItem('areLogsActive') -const areLogsActive = ref(cached ? cached === 'true' : false) - -const saveLogsSettings = () => { - localStorage.setItem('areLogsActive', areLogsActive.value) -} - -socket.addEventListener('message', event => { - if (!areLogsActive.value) { - return - } - - const newMessage = JSON.parse(event.data) - messages.value.push(Object.freeze(newMessage)) -}) - -export const useLogs = () => { - return { - messages, - areLogsActive, - saveLogsSettings - } -}