itube-specs 0.0.835 → 0.0.836

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.
@@ -82,14 +82,22 @@ const isDisliked = computed(() => likeStatus.value === 'dislike');
82
82
  const resultLikes = ref(props.likes);
83
83
  const resultDislikes = ref(props.dislikes);
84
84
 
85
- onMounted(() => {
85
+ function syncFromProps() {
86
+ likeStatus.value = null;
87
+ resultLikes.value = props.likes;
88
+ resultDislikes.value = props.dislikes;
89
+
86
90
  const stored = localStorage.getItem(storageKey.value);
87
91
  if (stored === 'like' || stored === 'dislike') {
88
92
  likeStatus.value = stored;
89
93
  if (stored === 'like') resultLikes.value += 1;
90
94
  if (stored === 'dislike') resultDislikes.value += 1;
91
95
  }
92
- });
96
+ }
97
+
98
+ onMounted(syncFromProps);
99
+
100
+ watch(storageKey, syncFromProps);
93
101
 
94
102
  async function onReactionClick(type: 'like' | 'dislike') {
95
103
  if (likeStatus.value !== type) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.835",
4
+ "version": "0.0.836",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {