mirror of
https://github.com/romancm/gamebrary
synced 2024-11-24 04:03:06 +00:00
Steam id in settings
This commit is contained in:
parent
1a22a402bc
commit
c52c46414e
2 changed files with 58 additions and 0 deletions
55
src/components/Settings/SteamSettings.vue
Normal file
55
src/components/Settings/SteamSettings.vue
Normal 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>
|
|
@ -5,6 +5,7 @@
|
||||||
<div class="d-inline-flex flex-column align-items-start">
|
<div class="d-inline-flex flex-column align-items-start">
|
||||||
<language-selector />
|
<language-selector />
|
||||||
<game-detail-settings />
|
<game-detail-settings />
|
||||||
|
<steam-settings />
|
||||||
<dock-settings />
|
<dock-settings />
|
||||||
|
|
||||||
<!-- <provider-card /> -->
|
<!-- <provider-card /> -->
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
<script>
|
<script>
|
||||||
import LanguageSelector from '@/components/Settings/LanguageSelector';
|
import LanguageSelector from '@/components/Settings/LanguageSelector';
|
||||||
import GameDetailSettings from '@/components/Settings/GameDetailSettings';
|
import GameDetailSettings from '@/components/Settings/GameDetailSettings';
|
||||||
|
import SteamSettings from '@/components/Settings/SteamSettings';
|
||||||
import DockSettings from '@/components/Settings/DockSettings';
|
import DockSettings from '@/components/Settings/DockSettings';
|
||||||
// import GameDetailViewSelector from '@/components/Settings/GameDetailViewSelector';
|
// import GameDetailViewSelector from '@/components/Settings/GameDetailViewSelector';
|
||||||
// import ProviderCard from '@/components/ProviderCard';
|
// import ProviderCard from '@/components/ProviderCard';
|
||||||
|
@ -43,6 +45,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
LanguageSelector,
|
LanguageSelector,
|
||||||
GameDetailSettings,
|
GameDetailSettings,
|
||||||
|
SteamSettings,
|
||||||
DockSettings,
|
DockSettings,
|
||||||
// GameDetailViewSelector,
|
// GameDetailViewSelector,
|
||||||
// ProviderCard,
|
// ProviderCard,
|
||||||
|
|
Loading…
Reference in a new issue