fix: hide add tag options if no tags available

This commit is contained in:
Antonella Sgarlatta
2021-05-05 15:31:34 -03:00
parent 323bc34ed6
commit 4308f4e656
2 changed files with 68 additions and 59 deletions

View File

@@ -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;
}
}