Skip to content

Commit

Permalink
ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nkanaev committed Aug 14, 2023
1 parent bed5640 commit 1e65a79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
:class="{'d-none': filterSelected
&& !(current.folder.id == folder.id || current.feed.folder_id == folder.id)
&& !filteredFolderStats[folder.id]
&& (!itemSelectedDetails || feedsById[itemSelectedDetails.feed_id].folder_id != folder.id)}">
&& (!itemSelectedDetails || (feedsById[itemSelectedDetails.feed_id] || {}).folder_id != folder.id)}">
<input type="radio" name="feed" :value="'folder:'+folder.id" v-model="feedSelected" v-if="folder.id">
<div class="selectgroup-label d-flex align-items-center w-100" v-if="folder.id">
<span class="icon mr-2"
Expand Down Expand Up @@ -274,7 +274,7 @@
<span class="icon icon-small mr-1" v-if="item.status=='starred'">{% inline "star-full.svg" %}</span>
</transition>
<small class="flex-fill text-truncate mr-1">
{{ feedsById[item.feed_id].title }}
{{ (feedsById[item.feed_id] || {}).title }}
</small>
<small class="flex-shrink-0"><relative-time v-bind:title="formatDate(item.date)" :val="item.date"/></small>
</div>
Expand Down Expand Up @@ -338,7 +338,7 @@
<div class="content-wrapper">
<h1><b>{{ itemSelectedDetails.title || 'untitled' }}</b></h1>
<div class="text-muted">
<div>{{ feedsById[itemSelectedDetails.feed_id].title }}</div>
<div>{{ (feedsById[itemSelectedDetails.feed_id] || {}).title }}</div>
<time>{{ formatDate(itemSelectedDetails.date) }}</time>
</div>
<hr>
Expand Down
13 changes: 3 additions & 10 deletions src/assets/javascripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ var vm = new Vue({
refreshItems: function(loadMore) {
if (this.feedSelected === null) {
vm.items = []
vm.itemsHasMore = false
return
}

Expand Down Expand Up @@ -516,10 +517,7 @@ var vm = new Vue({
deleteFolder: function(folder) {
if (confirm('Are you sure you want to delete ' + folder.title + '?')) {
api.folders.delete(folder.id).then(function() {
if (vm.feedSelected === 'folder:'+folder.id) {
vm.items = []
vm.feedSelected = ''
}
vm.feedSelected = null
vm.refreshStats()
vm.refreshFeeds()
})
Expand All @@ -536,12 +534,7 @@ var vm = new Vue({
deleteFeed: function(feed) {
if (confirm('Are you sure you want to delete ' + feed.title + '?')) {
api.feeds.delete(feed.id).then(function() {
// unselect feed to prevent reading properties of null in template
var isSelected = !vm.feedSelected
|| (vm.feedSelected === 'feed:'+feed.id
|| (feed.folder_id && vm.feedSelected === 'folder:'+feed.folder_id));
if (isSelected) vm.feedSelected = null

vm.feedSelected = null
vm.refreshStats()
vm.refreshFeeds()
})
Expand Down

0 comments on commit 1e65a79

Please sign in to comment.