fix: hide add tag options if no tags available
This commit is contained in:
@@ -68,6 +68,7 @@ export const NotesOptions = observer(
|
||||
</span>
|
||||
</Switch>
|
||||
<div className="h-1px my-2 bg-secondary-contrast"></div>
|
||||
{appState.tags.tagsCount > 0 && (
|
||||
<Disclosure
|
||||
open={tagsMenuOpen}
|
||||
onChange={() => {
|
||||
@@ -128,6 +129,7 @@ export const NotesOptions = observer(
|
||||
))}
|
||||
</DisclosurePanel>
|
||||
</Disclosure>
|
||||
)}
|
||||
<button
|
||||
onBlur={closeOnBlur}
|
||||
className={buttonClass}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ContentType, SNSmartTag, SNTag } from '@standardnotes/snjs';
|
||||
import { action, makeObservable, observable } from 'mobx';
|
||||
import { action, computed, makeObservable, observable } from 'mobx';
|
||||
import { WebApplication } from '../application';
|
||||
|
||||
export class TagsState {
|
||||
@@ -13,6 +13,9 @@ export class TagsState {
|
||||
makeObservable(this, {
|
||||
tags: observable,
|
||||
smartTags: observable,
|
||||
|
||||
tagsCount: computed,
|
||||
|
||||
addTagToSelectedNotes: action,
|
||||
});
|
||||
|
||||
@@ -43,4 +46,8 @@ export class TagsState {
|
||||
);
|
||||
this.application.sync();
|
||||
}
|
||||
|
||||
get tagsCount(): number {
|
||||
return this.tags.length;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user