From 8fc7a6cb1037e0a25763e3c6482f7d08f61299f5 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Wed, 26 May 2021 16:57:59 +0800 Subject: [PATCH] show error failed at prepare (fix) --- web/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/index.js b/web/index.js index dc125b6..193f7f3 100644 --- a/web/index.js +++ b/web/index.js @@ -568,7 +568,6 @@ const component_audio_player = { console.log(response.data) this.error_status = '' this.prepared_filesize = response.data.filesize - this.is_preparing = false var file = this.file this.playing_file = file this.set_playing_url() @@ -579,6 +578,8 @@ const component_audio_player = { } else { this.error_status = "Network error" } + }).finally(() => { + this.is_preparing = false }) }, set_playing_url() { @@ -637,12 +638,12 @@ const component_audio_player = { return this.error_status ? true : false }, computed_readable_size() { - if (this.error_status) { - return this.error_status - } if (this.is_preparing) { return 'Preparing...' } + if (this.error_status) { + return this.error_status + } let filesize = this.playing_file.filesize if (this.prepare) { filesize = this.prepared_filesize