feeds-fun 1.12.1 → 1.12.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feeds-fun",
3
- "version": "1.12.1",
3
+ "version": "1.12.2",
4
4
  "author": "Aliaksei Yaletski (Tiendil) <a.eletsky@gmail.com> (https://tiendil.org/)",
5
5
  "description": "Frontend for the Feeds Fun — web-based news reader",
6
6
  "keywords": [
@@ -91,15 +91,17 @@
91
91
 
92
92
  const properties = defineProps<{feed: t.Feed}>();
93
93
 
94
+ const noDescription = "No description";
95
+
94
96
  const purifiedTitle = computed(() => {
95
97
  if (properties.feed.title === null) {
96
- return "";
98
+ return properties.feed.url;
97
99
  }
98
100
 
99
- let title = DOMPurify.sanitize(properties.feed.title, {ALLOWED_TAGS: []});
101
+ let title = DOMPurify.sanitize(properties.feed.title, {ALLOWED_TAGS: []}).trim();
100
102
 
101
103
  if (title.length === 0) {
102
- return null;
104
+ return properties.feed.url;
103
105
  }
104
106
 
105
107
  return title;
@@ -107,8 +109,15 @@
107
109
 
108
110
  const purifiedDescription = computed(() => {
109
111
  if (properties.feed.description === null) {
110
- return "";
112
+ return noDescription;
111
113
  }
112
- return DOMPurify.sanitize(properties.feed.description);
114
+
115
+ let description = DOMPurify.sanitize(properties.feed.description).trim();
116
+
117
+ if (description.length === 0) {
118
+ return noDescription;
119
+ }
120
+
121
+ return description;
113
122
  });
114
123
  </script>
@@ -29,7 +29,12 @@ export const useFeedsStore = defineStore("feedsStore", () => {
29
29
 
30
30
  async function unsubscribe(feedId: t.FeedId) {
31
31
  await api.unsubscribe({feedId: feedId});
32
- globalSettings.updateDataVersion();
32
+
33
+ // Attention, do not call globalSettings.updateDataVersion
34
+ // it cause a lot of unnecessary requests to the server without any benefit
35
+ // we just remove feed from frontend
36
+
37
+ delete feeds.value[feedId];
33
38
  }
34
39
 
35
40
  async function subscribe(url: t.URL) {