Skip to content

Commit

Permalink
Merge pull request MrBrax#144 from MrBrax/develop-ts
Browse files Browse the repository at this point in the history
add back removed settings fetch
  • Loading branch information
MrBrax authored Apr 28, 2022
2 parents 9e56bf9 + e8769c5 commit 1ded139
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twitchautomator-client",
"version": "0.7.4",
"version": "0.7.4a",
"private": true,
"homepage": "https://github.com/MrBrax/TwitchAutomator",
"scripts": {
Expand Down
23 changes: 20 additions & 3 deletions client-vue/src/views/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export default defineComponent({
fetchData() {
console.debug("Fetching settings and games data");
this.loading = true;
this.$http
.get(`api/v0/games`)
this.$http.all([
this.$http.get(`api/v0/games`)
.then((response) => {
const json: ApiGamesResponse = response.data;
if (json.message) alert(json.message);
Expand All @@ -148,7 +148,24 @@ export default defineComponent({
console.error("settings fetch error", err.response);
}).finally(() => {
this.loading = false;
});
}),
this.$http
.get(`api/v0/settings`)
.then((response) => {
const json: ApiSettingsResponse = response.data;
if (json.message) alert(json.message);
const config = json.data.config;
const channels: ApiChannelConfig[] = json.data.channels;
const favourites = json.data.favourite_games;
this.favouritesData = favourites;
this.formChannels = channels.sort((a, b) => a.login.localeCompare(b.login));
})
.catch((err) => {
console.error("settings fetch error", err.response);
}),
]).finally(() => {
this.loading = false;
});
},
},
Expand Down

0 comments on commit 1ded139

Please sign in to comment.