Steam id in settings

This commit is contained in:
Gamebrary 2021-09-26 13:55:46 -07:00
parent 1a22a402bc
commit c52c46414e
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,55 @@
<template lang="html">
<div>
<b-form-group label="Steam ID:">
<b-form-input
v-model="steamId"
style="max-width: 200px"
@change="save"
/>
</b-form-group>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { GAME_DETAIL_VIEWS } from '@/constants';
export default {
data() {
return {
saving: false,
GAME_DETAIL_VIEWS,
steamId: null,
};
},
computed: {
...mapState(['settings']),
},
mounted() {
const { settings } = this;
this.steamId = settings && settings.steamId
? settings.steamId
: null;
},
methods: {
async save() {
const { steamId, settings } = this;
const payload = {
...settings,
steamId,
};
await this.$store.dispatch('SAVE_SETTINGS', payload)
.catch(() => {
this.$bvToast.toast('There was an error saving your settings', { variant: 'danger' });
this.saving = false;
});
},
},
};
</script>

View file

@ -5,6 +5,7 @@
<div class="d-inline-flex flex-column align-items-start">
<language-selector />
<game-detail-settings />
<steam-settings />
<dock-settings />
<!-- <provider-card /> -->
@ -32,6 +33,7 @@
<script>
import LanguageSelector from '@/components/Settings/LanguageSelector';
import GameDetailSettings from '@/components/Settings/GameDetailSettings';
import SteamSettings from '@/components/Settings/SteamSettings';
import DockSettings from '@/components/Settings/DockSettings';
// import GameDetailViewSelector from '@/components/Settings/GameDetailViewSelector';
// import ProviderCard from '@/components/ProviderCard';
@ -43,6 +45,7 @@ export default {
components: {
LanguageSelector,
GameDetailSettings,
SteamSettings,
DockSettings,
// GameDetailViewSelector,
// ProviderCard,