Update Loops to security release beta.15
This commit is contained in:
1 parent
3795736e5e
commit
a6ffa46d42
9 files changed
+154
-25
No files matched your search
@@ -0,0 +1,62 @@
|
||||
diff --git a/resources/js/composables/useFeed.js b/resources/js/composables/useFeed.js
|
||||
--- a/resources/js/composables/useFeed.js
|
||||
+++ b/resources/js/composables/useFeed.js
|
||||
@@ -4,9 +4,9 @@
|
||||
export const useFeed = () => {
|
||||
return useInfiniteQuery({
|
||||
- queryKey: ['feed'],
|
||||
+ queryKey: ['fyfeed'],
|
||||
queryFn: ({ pageParam }) => fetchFeedPage({ cursor: pageParam }),
|
||||
getNextPageParam: (lastPage) => lastPage.meta?.next_cursor ?? undefined,
|
||||
initialPageParam: null,
|
||||
enabled: true,
|
||||
- staleTime: 1000 * 60 * 5, // 5 minutes
|
||||
+ staleTime: 0,
|
||||
retry: 2
|
||||
})
|
||||
}
|
||||
diff --git a/resources/js/pages/index.vue b/resources/js/pages/index.vue
|
||||
--- a/resources/js/pages/index.vue
|
||||
+++ b/resources/js/pages/index.vue
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<FeedLayout>
|
||||
<SnapScrollFeed
|
||||
- key="local-feed"
|
||||
+ :key="authStore.authenticated ? 'recommended-feed' : 'public-feed'"
|
||||
:feed-data="feedData"
|
||||
:item-component="VideoPlayer"
|
||||
:get-item-props="getVideoProps"
|
||||
@@ -18,7 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
-import { inject, computed, shallowRef, watch } from 'vue'
|
||||
+import { inject, computed } from 'vue'
|
||||
import { useFeed } from '~/composables/useFeed'
|
||||
import { usePublicFeed } from '~/composables/usePublicFeed'
|
||||
import { useFeedInteraction } from '~/composables/useFeedInteraction'
|
||||
@@ -28,20 +28,10 @@
|
||||
|
||||
const authStore = inject('authStore')
|
||||
|
||||
-const activeFeed = shallowRef(null)
|
||||
-
|
||||
const { hasInteracted, handleFirstInteraction, globalMuted } = useFeedInteraction()
|
||||
|
||||
-watch(
|
||||
- () => authStore.authenticated,
|
||||
- (isAuthenticated, _, onCleanup) => {
|
||||
- activeFeed.value = isAuthenticated ? useFeed() : usePublicFeed()
|
||||
- },
|
||||
- { immediate: true }
|
||||
-)
|
||||
-
|
||||
-const feedData = computed(() => {
|
||||
- return activeFeed.value
|
||||
-})
|
||||
+const authenticatedFeed = useFeed()
|
||||
+const publicFeed = usePublicFeed()
|
||||
+const feedData = computed(() => authStore.authenticated ? authenticatedFeed : publicFeed)
|
||||
|
||||
const getVideoProps = (post, index) => ({
|
||||
Reference in new issue
Block a user