From 17dcd4329018624fa518b821b605110ff948b787 Mon Sep 17 00:00:00 2001 From: Shiny Nematoda Date: Sun, 2 Apr 2023 21:44:04 +0530 Subject: [PATCH] closes #119 --- src/components/NewPlaylist.vue | 12 +++--------- src/components/Playlists.vue | 33 ++++++++++++++++++--------------- src/components/Prefs.vue | 21 ++++++++++++++++++--- src/scripts/dash.js | 5 ++--- src/scripts/fetch.js | 34 +++++++++++++++++++++++----------- src/scripts/xml.js | 4 +--- 6 files changed, 65 insertions(+), 44 deletions(-) diff --git a/src/components/NewPlaylist.vue b/src/components/NewPlaylist.vue index a2dd33a..cd39e07 100644 --- a/src/components/NewPlaylist.vue +++ b/src/components/NewPlaylist.vue @@ -15,6 +15,7 @@ import { } from '@/scripts/db.js'; import { + useAuthLogout, useAuthCreatePlaylist, getAuthPlaylists, getJsonAuth, @@ -134,9 +135,7 @@ const Open = async key => { }); } } - } else { - useCreatePlaylist(i.name, i.urls); - } + } else useCreatePlaylist(i.name, i.urls); List(); } @@ -206,12 +205,7 @@ const Login = async () => { } }, Logout = async () => { - const res = await getJsonAuth('/logout', { - method: 'POST', - headers: { - Authorization: store.auth, - }, - }); + const res = await useAuthLogout(); if (!res.error) { store.removeItem('auth'); diff --git a/src/components/Playlists.vue b/src/components/Playlists.vue index 54b2c04..7710326 100644 --- a/src/components/Playlists.vue +++ b/src/components/Playlists.vue @@ -1,6 +1,6 @@