0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 Fix #tags added via PSM having "public" visibility (#841)

refs TryGhost/Ghost#8943
- Tag model has an observer watching the `isNew` and `name` properties so that it can set the `visibility: "internal"` property for new tags based on their name starting with a `#`
- PSM creates tags using `store.createRecord('tag', {name: tagName})` which means that the tag is instantiated with the `isNew` and `name` properties already set (unlike the tags screen where an empty tag is first created before the name is set via UI) - because the properties are there before at instantiation the observer never fires because it's only watching for changes
- adds the `.on('init')` modifier to the `setVisibilityOnNew` observer so that it's run for the watched properties during instantiation as well as on change
This commit is contained in:
Kevin Ansfield 2017-08-29 04:19:47 +01:00 committed by Aileen Nowak
parent 18d7a7b55d
commit b5987a6979

View file

@ -53,5 +53,5 @@ export default Model.extend(ValidationEngine, {
if (this.get('isNew') && !this.get('isSaving')) {
this.setVisibility();
}
})
}).on('init')
});