diff --git a/packages/renderer/src/pages/Options/OptionsAnime365/Anime365SubscribeStatus.vue b/packages/renderer/src/pages/Options/OptionsAnime365/Anime365SubscribeStatus.vue new file mode 100644 index 00000000..cbd6347d --- /dev/null +++ b/packages/renderer/src/pages/Options/OptionsAnime365/Anime365SubscribeStatus.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/packages/renderer/src/pages/Options/OptionsAnime365/OptionsAnime365.vue b/packages/renderer/src/pages/Options/OptionsAnime365/OptionsAnime365.vue index 9836d6a1..c1066d3c 100644 --- a/packages/renderer/src/pages/Options/OptionsAnime365/OptionsAnime365.vue +++ b/packages/renderer/src/pages/Options/OptionsAnime365/OptionsAnime365.vue @@ -1,9 +1,10 @@ +import Anime365SubscribeStatus from '/@/pages/Options/OptionsAnime365/Anime365SubscribeStatus.vue'; diff --git a/packages/renderer/src/pages/Options/OptionsAnime365/OptionsAnime365Token.vue b/packages/renderer/src/pages/Options/OptionsAnime365/OptionsAnime365Token.vue index 693e4fea..9262bab4 100644 --- a/packages/renderer/src/pages/Options/OptionsAnime365/OptionsAnime365Token.vue +++ b/packages/renderer/src/pages/Options/OptionsAnime365/OptionsAnime365Token.vue @@ -2,11 +2,9 @@ import {computed, ref} from 'vue'; import type * as sm from '/@/utils/videoProvider/providers/anime365/anime365-interfaces'; import {getAccessToken, saveAccessToken} from '/@/utils/videoProvider/providers/anime365/anime365'; -import {ANIME365_ORIGIN} from '/@/utils/videoProvider/providers/anime365/utils'; -import {useTokenValidator} from '/@/pages/Options/OptionsAnime365/useTokenValidator'; -import ButtonSpinner from '/@/components/ButtonSpinner.vue'; +import {ANIME365_ORIGIN, isFailureResponse} from '/@/utils/videoProvider/providers/anime365/utils'; import ExternalLink from '/@/components/ExternalLink.vue'; -import {isFailureResponse} from '/@/utils/videoProvider/providers/anime365/utils'; +import Anime365SubscribeStatus from '/@/pages/Options/OptionsAnime365/Anime365SubscribeStatus.vue'; const emit = defineEmits({ @@ -54,23 +52,22 @@ const token = computed(() => : (inputObjValue.value as sm.ApiResponseSuccess).data.access_token || '', ); -const {isValid, isLoading, check} = useTokenValidator(token); - const save = () => { - if (isValid.value === true || isValid.value === undefined) { - saveAccessToken(token.value ? token.value : null); - emit('save'); - } + saveAccessToken(token.value ? token.value : null); + emit('save'); + savedAccessToken.value = token.value; }; + + +let savedAccessToken = ref(getAccessToken() || undefined); + + diff --git a/packages/renderer/src/utils/videoProvider/providers/anime365/anime365.ts b/packages/renderer/src/utils/videoProvider/providers/anime365/anime365.ts index 49881300..675a2b05 100644 --- a/packages/renderer/src/utils/videoProvider/providers/anime365/anime365.ts +++ b/packages/renderer/src/utils/videoProvider/providers/anime365/anime365.ts @@ -219,7 +219,7 @@ export function clearVideosCache(translationId: number | string): Promise(requestURL, access_token, options); + + if (isFailureResponse(apiResponse)) { + throw apiResponse; + } + + return apiResponse.data; +}