itube-specs 0.0.515 → 0.0.516

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.
@@ -98,7 +98,13 @@ onMounted(() => {
98
98
  checkIsElementOverflow();
99
99
  });
100
100
 
101
+ let checkTimer: ReturnType<typeof setTimeout> | null = null;
102
+
101
103
  watch(() => useRoute().query, () => {
102
- setTimeout(() => checkIsElementOverflow(), 100)
103
- })
104
+ checkTimer = setTimeout(() => checkIsElementOverflow(), 100);
105
+ });
106
+
107
+ onBeforeUnmount(() => {
108
+ if (checkTimer) clearTimeout(checkTimer);
109
+ });
104
110
  </script>
@@ -11,7 +11,7 @@
11
11
  </template>
12
12
 
13
13
  <script setup lang="ts">
14
- import { convertString, EAsyncData } from 'itube-specs/runtime';
14
+ import { convertString } from 'itube-specs/runtime';
15
15
  import type { IModelCard } from 'itube-specs/types';
16
16
 
17
17
  const props = defineProps<{
@@ -203,7 +203,7 @@ async function submit() {
203
203
  if (!valid) return;
204
204
 
205
205
  try {
206
- const baseURL = window.location.origin;
206
+ const baseURL = process.client ? window.location.origin : '';
207
207
  loading.value = true;
208
208
  form.value.token = await getRecaptchaToken('contact_form');
209
209
  form.value.url = `${baseURL}/videos/${reportedVideoCard.value.id}`;
@@ -55,13 +55,17 @@ const {isSharePopupOpen, closeSharePopup, sharedVideoCard} = useSharePopup();
55
55
  const route = useRoute();
56
56
 
57
57
  const isCopied = ref(false);
58
+ let copyTimeout: ReturnType<typeof setTimeout> | null = null;
58
59
 
59
- const fullUrl = computed(() => window.location.origin + route.fullPath);
60
+ const fullUrl = computed(() =>
61
+ (process.client ? window.location.origin : '') + route.fullPath
62
+ );
60
63
 
61
64
  function copyUrl() {
65
+ if (!process.client) return;
62
66
  navigator.clipboard.writeText(fullUrl.value).then(() => {
63
- isCopied.value = true
64
- })
67
+ isCopied.value = true;
68
+ });
65
69
  }
66
70
 
67
71
  const copyIcon = computed(() => isCopied.value ? 'check' : 'copy');
@@ -69,9 +73,13 @@ const inputText = computed(() => isCopied.value ? t('link_copied') : t('link'));
69
73
 
70
74
  watch(() => isCopied.value, (value) => {
71
75
  if (value) {
72
- setTimeout(() => isCopied.value = false, 3000)
76
+ copyTimeout = setTimeout(() => isCopied.value = false, 3000);
73
77
  }
74
- })
78
+ });
79
+
80
+ onBeforeUnmount(() => {
81
+ if (copyTimeout) clearTimeout(copyTimeout);
82
+ });
75
83
 
76
84
  const { t } = useI18n()
77
85
 
@@ -3,7 +3,7 @@
3
3
  <SToggle
4
4
  class="s-playlist-private-toggle__toggler"
5
5
  :model-value="modelValue"
6
- @update:model-value="(event: Event) => emit('update:modelValue', event)"
6
+ @update:model-value="(value: boolean) => emit('update:modelValue', value)"
7
7
  />
8
8
  <p class="s-playlist-private-toggle__text">{{ $t('playlist.private_playlist')}}</p>
9
9
  </div>
@@ -15,6 +15,6 @@ defineProps<{
15
15
  }>()
16
16
 
17
17
  const emit = defineEmits<{
18
- (eventName: 'update:modelValue', value: Event): void
18
+ (eventName: 'update:modelValue', value: boolean): void
19
19
  }>()
20
20
  </script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.515",
4
+ "version": "0.0.516",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {