Skip to content

Commit

Permalink
fix: use useRouter composable instead $router
Browse files Browse the repository at this point in the history
  • Loading branch information
benya7 committed Oct 6, 2024
1 parent b39482d commit fec99fc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
6 changes: 4 additions & 2 deletions packages/renderer/src/components/home/contentSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
size="small"
class="mt-3 mb-1 text-none"
text="Play now"
@click="item.category && item.contentCID && $router.push(`/release/${item.category}/${item.contentCID}`)"
@click="item.category && item.contentCID && router.push(`/release/${item.category}/${item.contentCID}`)"
></v-btn>
</v-card-actions>
</v-img>
Expand All @@ -131,7 +131,7 @@
class="mx-auto"
width="170px"
color="transparent"
@click="item.category === 'video' && item.contentCID && $router.push(`/release/${item.category}/${item.contentCID}`)"
@click="item.category === 'video' && item.contentCID && router.push(`/release/${item.category}/${item.contentCID}`)"
>
<v-img
:src="item.thumbnail"
Expand Down Expand Up @@ -195,6 +195,8 @@

<script setup lang="ts">
import type { ItemContent } from '/@/views/homePage.vue';
import { useRouter } from 'vue-router';
const router = useRouter();
interface Props {
Expand Down
4 changes: 3 additions & 1 deletion packages/renderer/src/components/home/featuredSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
prepend-icon="fas fa-play"
class="text-none mr-4"
text="Play now"
@click="featured.category && featured.contentCID && $router.push(`/release/${featured.category}/${featured.contentCID}`)"
@click="featured.category && featured.contentCID && router.push(`/release/${featured.category}/${featured.contentCID}`)"
></v-btn>
</div>
</v-sheet>
Expand Down Expand Up @@ -99,6 +99,8 @@

<script setup lang="ts">
import type { FeaturedItem } from '/@/views/homePage.vue';
import { useRouter } from 'vue-router';
const router = useRouter();
interface Props {
featuredList: Array<FeaturedItem>
Expand Down
9 changes: 6 additions & 3 deletions packages/renderer/src/components/layout/appFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
></v-img>
<v-list-item
subtitle="Riff.CC is a dynamic platform for music, videos, and creative content. Discover, share, and enjoy a wide variety of multimedia in one place."
class="pa-0 mb-2"
class="pa-0"
></v-list-item>
<br />
<v-list-item
subtitle="This is an early tech demo, work in progress. It is intended only as a proof of concept but may be interesting and enjoyable. No warranties are given, here be dragons, but enjoy."
class="pa-0 mb-2"
class="pa-0"
></v-list-item>
<br />
<v-list-item
Expand Down Expand Up @@ -56,7 +56,7 @@
class="mb-2 pl-1"
min-height="12px"
height="24px"
@click="() => $router.push(item.path)"
@click="router.push(item.path)"
></v-list-item>
</v-list>
</div>
Expand Down Expand Up @@ -93,8 +93,11 @@
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';
import { navigationMap } from '/@/constants/navigation';
const router = useRouter();
const scrollToTop = () => {
window.scrollTo({
top: 0,
Expand Down
4 changes: 3 additions & 1 deletion packages/renderer/src/components/releases/videoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
icon="fa:fas fa-arrow-left"
class="position-absolute top-0 left-0 mt-2 ml-2"
:style="{ zIndex: 1000 }"
@click="$router.back()"
@click="router.back()"
></v-btn>

<video
Expand Down Expand Up @@ -106,6 +106,8 @@
<script setup lang="ts">
import type { Ref } from 'vue';
import { onMounted, onBeforeUnmount, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const propsComponent = defineProps<{
videoSource: string;
Expand Down

0 comments on commit fec99fc

Please sign in to comment.