From 6f3a749e52a91dd9966fc52ac0247c5cd6575d6c Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Fri, 26 Nov 2021 18:29:00 -0600 Subject: [PATCH] fix: default to feature status entitled to avoid temporarily flashing error --- app/assets/javascripts/components/ComponentView/index.tsx | 2 +- app/assets/javascripts/views/tags/tags-view.pug | 2 +- app/assets/javascripts/views/tags/tags_view.ts | 4 ++-- package.json | 4 ++-- yarn.lock | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/components/ComponentView/index.tsx b/app/assets/javascripts/components/ComponentView/index.tsx index 3e7473114..48dc8d023 100644 --- a/app/assets/javascripts/components/ComponentView/index.tsx +++ b/app/assets/javascripts/components/ComponentView/index.tsx @@ -46,7 +46,7 @@ export const ComponentView: FunctionalComponent = observer( const [isLoading, setIsLoading] = useState(false); const [isReloading, setIsReloading] = useState(false); const [loadTimeout, setLoadTimeout] = useState(undefined); - const [featureStatus, setFeatureStatus] = useState(undefined); + const [featureStatus, setFeatureStatus] = useState(FeatureStatus.Entitled); const [isComponentValid, setIsComponentValid] = useState(true); const [error, setError] = useState<'offline-restricted' | 'url-missing' | undefined>(undefined); const [isDeprecated, setIsDeprecated] = useState(false); diff --git a/app/assets/javascripts/views/tags/tags-view.pug b/app/assets/javascripts/views/tags/tags-view.pug index a32bb709e..344153a98 100644 --- a/app/assets/javascripts/views/tags/tags-view.pug +++ b/app/assets/javascripts/views/tags/tags-view.pug @@ -1,5 +1,5 @@ #tags-column.sn-component.section.tags(aria-label='Tags') - .component-view-container(ng-if='self.component.active') + .component-view-container(ng-if='self.component && self.component.active') component-view.component-view( component-uuid='self.component.uuid', application='self.application' diff --git a/app/assets/javascripts/views/tags/tags_view.ts b/app/assets/javascripts/views/tags/tags_view.ts index 241d273b2..a117ee546 100644 --- a/app/assets/javascripts/views/tags/tags_view.ts +++ b/app/assets/javascripts/views/tags/tags_view.ts @@ -106,9 +106,9 @@ class TagsViewCtrl extends PureViewCtrl { beginStreamingItems() { this.removeFoldersObserver = this.application.streamItems( [ContentType.Component], - async (_items) => { + async () => { this.component = this.application.componentManager - .componentsForArea(ComponentArea.TagsList)[0]; + .componentsForArea(ComponentArea.TagsList).find((component) => component.active); }); this.removeTagsObserver = this.application.streamItems( diff --git a/package.json b/package.json index aba44f352..d631b48e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "standard-notes-web", - "version": "3.9.4", + "version": "3.9.5", "license": "AGPL-3.0-or-later", "repository": { "type": "git", @@ -72,7 +72,7 @@ "@reach/listbox": "^0.16.2", "@standardnotes/features": "1.9.0", "@standardnotes/sncrypto-web": "1.5.3", - "@standardnotes/snjs": "2.18.0", + "@standardnotes/snjs": "2.18.2", "mobx": "^6.3.5", "mobx-react-lite": "^3.2.1", "preact": "^10.5.15", diff --git a/yarn.lock b/yarn.lock index 9cb80fca3..fc9e57e78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2200,10 +2200,10 @@ buffer "^6.0.3" libsodium-wrappers "^0.7.9" -"@standardnotes/snjs@2.18.0": - version "2.18.0" - resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.18.0.tgz#0256998cc63902a54bc211aa6808d3dd64d13ef2" - integrity sha512-wwe+zyN7hYUZaoqVSinNNeKO0ng5xqYt0MD6Ga31EM0i1xm10GVP4QOjyzcgiEjEHbWXpTEC8MSw6gU6Glrwbg== +"@standardnotes/snjs@2.18.2": + version "2.18.2" + resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.18.2.tgz#42957cf50b18e2db3f10dacb2c3dfa95c16719e7" + integrity sha512-KcYRwxJJmA+b9E0xXJGDsdCC3ptNaDLiGDpB8Lv4lUpjH6Z1VC43oxhFDXVxLLrQxTpQULvhlkW8Mc38Kxtzxg== dependencies: "@standardnotes/auth" "^3.8.1" "@standardnotes/common" "^1.2.1"