From 54f7bf9d49ecc2c9e7fcda52d60168e33c2b2342 Mon Sep 17 00:00:00 2001 From: Daniel Jakob Date: Tue, 5 Oct 2021 18:45:50 +0200 Subject: [PATCH] Add debug mode switch --- .env | 3 ++- .env.production | 1 + src/components/Lib/Player.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env b/.env index e1b5f82..6deac1c 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ -VITE_API_URL=http://localhost:8888/ \ No newline at end of file +VITE_API_URL=http://localhost:8888/ +VITE_DEBUG_MODE=true \ No newline at end of file diff --git a/.env.production b/.env.production index f20613f..9ef27a7 100644 --- a/.env.production +++ b/.env.production @@ -1 +1,2 @@ VITE_API_URL=/api/ +VITE_DEBUG_MODE=false \ No newline at end of file diff --git a/src/components/Lib/Player.ts b/src/components/Lib/Player.ts index 0c36d96..44a9679 100644 --- a/src/components/Lib/Player.ts +++ b/src/components/Lib/Player.ts @@ -10,6 +10,7 @@ import SongListItemInterface from '../../model/SongListItemInterface'; export default class Player { static init(app: DefineComponent, songList: Array = [{url: ''}]) { + amplitudejs.stop(); amplitudejs.init({ @@ -23,7 +24,7 @@ export default class Player { Player.scrollPlaylist(song.index); }, }, - debug: true, + debug: import.meta.env.VITE_DEBUG_MODE == 'true', delay: 250, continue_next: true });