Skip to content

Commit

Permalink
fix(client): several fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mryanshenghong committed Jul 27, 2022
1 parent bd7f4c0 commit 9978bae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/Blog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</template>

<script lang="ts" setup>
import { computed, nextTick, onMounted, ref, reactive } from "vue";
import { computed, ref, reactive } from "vue";
import { format } from "@/utils/formatTime";
import { useStore } from "@/store";
Expand Down Expand Up @@ -102,15 +102,15 @@ const formatTime = (time: string) => format(time);
// const toggleDrawer = (isDrawerShow: boolean) => (state.isDrawerShow = isDrawerShow);
const onMusicPlay = () => {
if (currentMediaRef.value) currentMediaRef.value.ele.pause();
if (currentMediaRef) currentMediaRef.value.ele.pause();
store.commit("setMediaRef", {
type: "music",
ele: musicPlayerRef,
});
};
const onVideoPlay = () => {
if (currentMediaRef.value) currentMediaRef.value.ele.pause();
if (currentMediaRef) currentMediaRef.value.ele.pause();
store.commit("setMediaRef", {
type: "video",
ele: videoPlayerRef,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/components/Blogs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</template>

<script lang="ts" setup>
import { computed, ref } from "vue";
import { computed } from "vue";
import vuescroll from "vuescroll";
import CardView from "@/components/CardView.vue";
import { useStore } from "@/store";
Expand Down
4 changes: 3 additions & 1 deletion src/store/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export default {
state.user = user;
},
setMediaRef(state, mediaRef: any) {
state.currentMediaRef = mediaRef;
Object.assign(state, {
currentMediaRef: mediaRef,
});
},
} as MutationTree<GlobalState>;

0 comments on commit 9978bae

Please sign in to comment.