Я немного запутался, эта часть асинхронного кода не работает. Вот проблема:
export async function active() {
return new Promise(function(resolve,reject){
fetch("https://api.spotify.com/v1/me", { //omitted headers to keep it clean
}).then(response => console.log(response)) <-- This code runs, and will log a response
.then(data => function(){ <-- but this won't
console.log("This won't run either")
if (data.status == 200) {
console.log(true)
resolve(data)
} else {
console.log(false)
reject(data)
}
})
})
}
Почему не запускается вторая часть? Извините, я немного новичок в async / await