From 7716d1458b4d7b730b03d5c875e1a8be82605e8e Mon Sep 17 00:00:00 2001 From: Tachibana Shin Date: Tue, 13 Jun 2023 15:38:40 +0700 Subject: [PATCH] 128 phimseason not show screen error if use cache (#129) * fix not show screen error if exists cache * no-spinner avatar * if error cloudflare -> reload --- src/components/errors/cloudflare.vue | 3 ++- src/layouts/MainLayout.vue | 1 + src/pages/phim/_season.vue | 22 ++++++++++++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/errors/cloudflare.vue b/src/components/errors/cloudflare.vue index d10c66ed..efaeac1f 100644 --- a/src/components/errors/cloudflare.vue +++ b/src/components/errors/cloudflare.vue @@ -32,7 +32,7 @@ no-caps outline rounded - @click="retry" + @click="reload" style="color: #00be06" >{{ t("thu-lai") }} @@ -53,6 +53,7 @@ const { t } = useI18n() function openAnimeVietsub() { window.open(C_URL) } +const reload = () => location.reload() diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index a2c9811a..e322b218 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -624,6 +624,7 @@
@@ -118,7 +118,7 @@
-
+

settingsStore.player.server, async (server) => { + loadedServerFB = false try { if (server === "DU") { if (typeCurrentConfig !== "DU") - // eslint-disable-next-line promise/catch-or-return PlayerLink(currentMetaChap).then((conf) => { // eslint-disable-next-line promise/always-return if (settingsStore.player.server === "DU") { @@ -1238,25 +1240,33 @@ watch( typeCurrentConfig = "DU" } }) + .catch(err => { + error.value =err + }) } if (server === "FB") { // PlayerFB は常に PlayerLink よりも遅いため、DU を使用して高速プリロード戦術を使用する必要があります。 if (typeCurrentConfig !== "DU") - // eslint-disable-next-line promise/catch-or-return PlayerLink(currentMetaChap).then((conf) => { // eslint-disable-next-line promise/always-return - if (settingsStore.player.server === "DU") { + if (!loadedServerFB && settingsStore.player.server === "DU") { configPlayer.value = conf typeCurrentConfig = "DU" } }) - // eslint-disable-next-line promise/catch-or-return + .catch(err => { + error.value =err + }) PlayerFB(currentMetaChap.id).then((conf) => { // eslint-disable-next-line promise/always-return if (settingsStore.player.server === "FB") { configPlayer.value = conf typeCurrentConfig = "FB" } + loadedServerFB = true + }) + .catch(err => { + error.value =err }) } } catch (err) {