diff --git a/src/components/ProfileManager.vue b/src/components/ProfileManager.vue index e6208c7..3e4e834 100644 --- a/src/components/ProfileManager.vue +++ b/src/components/ProfileManager.vue @@ -49,8 +49,8 @@ + :selected="currentProfileId===profile.id" + @select="currentProfileId=profile.id" /> @@ -60,7 +60,7 @@ \ No newline at end of file diff --git a/src/store.js b/src/store.js index 71ae632..434f267 100644 --- a/src/store.js +++ b/src/store.js @@ -1,9 +1,15 @@ -import { reactive } from 'vue' +import { computed, reactive } from 'vue' export const store = reactive({ device: { profiles: [], - activeProfile: null, + activeProfileId: null, + activeProfile: computed(() => { + return store.device.profiles.find(p => p.id === store.device.activeProfileId) + }), }, - currentProfile: null, + currentProfileId: null, + currentProfile: computed(() => { + return store.device.profiles.find(p => p.id === store.currentProfileId) + }), }) \ No newline at end of file