mirror of
https://github.com/TeamPiped/Piped.git
synced 2026-03-15 13:07:00 +00:00
feat: alert api error messages in feed and subscriptions
This commit is contained in:
20
src/main.js
20
src/main.js
@@ -204,6 +204,26 @@ const mixin = {
|
||||
}
|
||||
}
|
||||
},
|
||||
async fetchFeed() {
|
||||
if (this.authenticated) {
|
||||
return await this.fetchJson(this.authApiUrl() + "/feed", {
|
||||
authToken: this.getAuthToken(),
|
||||
});
|
||||
} else {
|
||||
const channels = this.getUnauthenticatedChannels();
|
||||
const split = channels.split(",");
|
||||
if (split.length > 100) {
|
||||
return await this.fetchJson(this.authApiUrl() + "/feed/unauthenticated", null, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(split),
|
||||
});
|
||||
} else {
|
||||
return await this.fetchJson(this.authApiUrl() + "/feed/unauthenticated", {
|
||||
channels: channels,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
/* generate a temporary file and ask the user to download it */
|
||||
download(text, filename, mimeType) {
|
||||
var file = new Blob([text], { type: mimeType });
|
||||
|
||||
Reference in New Issue
Block a user