Skip to content

Commit

Permalink
fix pinia state
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Jul 28, 2024
1 parent 1f5af9b commit c531798
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/AdminManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@
<script>
import mixins from "@/mixins/mixins";
import { computed } from "vue";
import { mapState, useStore } from "vuex";
import { useStore } from "vuex";
import { mapState as piniaMapState } from "pinia";
import { useAuthStore } from "@/stores/auth";
import UserForm from "@/components/modals/admin/UserForm.vue";
import UserResetPasswordForm from "@/components/modals/admin/UserResetPasswordForm.vue";
Expand Down Expand Up @@ -316,7 +318,7 @@ export default {
},
},
computed: {
...mapState({
...piniaMapState(useAuthStore, {
logged_in_user: (state) => state.username,
}),
},
Expand Down
5 changes: 3 additions & 2 deletions src/components/modals/admin/UserForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
</template>

<script>
import { mapState } from "vuex";
import { mapState as piniaMapState } from "pinia";
import { useAuthStore } from "@/stores/auth";
import mixins from "@/mixins/mixins";
export default {
Expand Down Expand Up @@ -145,7 +146,7 @@ export default {
title() {
return this.user ? "Edit User" : "Add User";
},
...mapState({
...piniaMapState(useAuthStore, {
logged_in_user: (state) => state.username,
}),
},
Expand Down

0 comments on commit c531798

Please sign in to comment.