Compare commits

..

1 Commits

Author SHA1 Message Date
Artem Anufrij
2b79f47d57 push history item after 10%. fix #27
All checks were successful
continuous-integration/drone/push Build is passing
2023-10-04 11:29:32 +02:00
5 changed files with 10 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
{
"backend_dev": "http://localhost:31204",
"backend_de": "https://webplay.rocks",
"backend_de": "http://localhost:31204",
"backend_dev": "https://webplay.rocks",
"backend": "https://webplay.rocks"
}

View File

@@ -146,8 +146,6 @@ export default {
this.audio.pause();
this.audio.src = url;
this.pushHistoryItem();
if (this.currentTrackParent.progress) {
if (this.currentTrackParent.progress.id == this.selectedTrack._id) {
this.skipToSecond(this.currentTrackParent.progress.progress);
@@ -297,6 +295,7 @@ export default {
track: this.selectedTrack,
rate: this.audioBpm,
});
this.pushHistoryItem();
}
},
},

View File

@@ -3,18 +3,12 @@ import axios from 'axios'
export default {
checkIfInstanceIsNew(context) {
return new Promise((resolve) => {
axios
.get(context.rootGetters.server + "/api/system/setup")
.then((res) => {
console.log(res.status);
axios.get(context.rootGetters.server + "/api/system/setup").then((res) => {
if (res.status == 200) {
resolve(true);
} else {
resolve(false);
}
})
.catch(err => {
console.log(err);
});
});
},

View File

@@ -10,13 +10,11 @@ export default {
load(context) {
return new Promise((resolve, reject) => {
axios.get(context.rootGetters.server + "/api/user/login", context.rootGetters.headers).then((res) => {
console.log(res.data);
context.commit("load", res.data);
context.rootState["player"].shuffle = res.data.player.shuffle;
context.rootState["player"].repeatType = res.data.player.repeat;
resolve();
}).catch(err => {
console.log("error")
context.commit("resetToken");
reject(err);
});

View File

@@ -123,17 +123,13 @@ export default {
checkTocken() {
let token = localStorage.getItem("token");
if (token) {
console.log("hello token")
this.$store.dispatch("user/setToken", token);
console.log("hello token; user/load")
this.$store
.dispatch("user/load")
.then(() => {
console.log("user loaded")
this.goto();
})
.catch((err) => {
console.log("user not loaded")
console.log(err);
this.checkIfNewBackend();
});
@@ -161,7 +157,6 @@ export default {
});
},
checkIfNewBackend() {
console.log("check new instance")
this.$store.dispatch("checkIfInstanceIsNew").then((res) => {
if (res) {
this.$router.replace("setup");