itube-specs 0.0.788 → 0.0.789
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -51,15 +51,14 @@ export const useFetchVideo = async (
|
|
|
51
51
|
)(),
|
|
52
52
|
);
|
|
53
53
|
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
// и
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (value && route.name === videoRouteName) refresh();
|
|
54
|
+
// Рефетч ТОЛЬКО при смене ?view (переключение ролика плеером/next-video без смены path).
|
|
55
|
+
// НЕ следим за identifier/slug: смена path-параметра сама пересоздаёт страницу (дефолтный
|
|
56
|
+
// key <NuxtPage> = путь с подставленным параметром) → setup перезапускается и фетчит заново.
|
|
57
|
+
// Следить за slug нельзя: route.params.slug общий для всех [slug]-роутов, и при уходе на
|
|
58
|
+
// /categories/<slug> и т.п. watch дёргал бы getVideoById с чужим слагом (400 + ложный 404).
|
|
59
|
+
// ?view при таком уходе не становится истинным, поэтому рефетча на уходе нет.
|
|
60
|
+
watch(view, (value) => {
|
|
61
|
+
if (value) refresh();
|
|
63
62
|
});
|
|
64
63
|
|
|
65
64
|
return { data, status, error };
|