fix: suggestions update

This commit is contained in:
Akuoko Daniel Jnr 2021-03-21 20:09:11 +00:00
parent ce5b5b4c98
commit 089d271e02
No known key found for this signature in database
GPG Key ID: 1C95803CACD3E9DC
3 changed files with 10 additions and 8 deletions

View File

@ -495,8 +495,7 @@ class CarouselSidebarData extends React.Component {
};
_handleTagDelete = async (tag) => {
const response = UserBehaviors.deleteTag(tag);
const response = await UserBehaviors.deleteTag(tag);
if (response.success) {
this.props.onUpdateViewer({ tags: response.tags });
this.updateSuggestions();

View File

@ -349,10 +349,10 @@ export default class CarouselSidebarSlate extends React.Component {
};
_handleTagDelete = async (tag) => {
const response = await Actions.deleteTag({ tag });
const response = await UserBehaviors.deleteTag(tag);
if (response.success) {
this.setState({ suggestions: response.tags });
this.props.onUpdateViewer({ tags: response.tags });
this.updateSuggestions();
}
if (Events.hasError(response)) {

View File

@ -76,10 +76,13 @@ export default class SidebarSingleSlateSettings extends React.Component {
slate.data.tags = this.state.tags;
this.props.onUpdateViewer({ slates, tags: this.state.suggestions });
break;
}
}
this.updateSuggestions();
this.props.onCancel();
const response = await Actions.updateSlate({
id: this.props.data.id,
@ -128,10 +131,10 @@ export default class SidebarSingleSlateSettings extends React.Component {
};
_handleTagDelete = async (tag) => {
const response = await Actions.deleteTag({ tag });
const response = await UserBehaviors.deleteTag(tag);
if (response.success) {
this.setState({ suggestions: response.tags });
this.props.onUpdateViewer({ tags: response.tags });
this.updateSuggestions();
}
if (Events.hasError(response)) {