mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 06:29:29 +01:00
correctly update global state on change
This commit is contained in:
@@ -14,6 +14,8 @@ import {opacity, ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
|
|||||||
import {db} from '../../utils/DB';
|
import {db} from '../../utils/DB';
|
||||||
import {DDS} from '../../services/DeviceDetection';
|
import {DDS} from '../../services/DeviceDetection';
|
||||||
import Seperator from '../Seperator';
|
import Seperator from '../Seperator';
|
||||||
|
import { updateEvent } from '../DialogManager/recievers';
|
||||||
|
import { Actions } from '../../provider/Actions';
|
||||||
|
|
||||||
export class AddTopicDialog extends React.Component {
|
export class AddTopicDialog extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -41,6 +43,7 @@ export class AddTopicDialog extends React.Component {
|
|||||||
await db.notebooks.notebook(topic.notebookId).topics.add(topic);
|
await db.notebooks.notebook(topic.notebookId).topics.add(topic);
|
||||||
}
|
}
|
||||||
this.close();
|
this.close();
|
||||||
|
updateEvent({type:Actions.NOTEBOOKS})
|
||||||
eSendEvent(eOnNewTopicAdded);
|
eSendEvent(eOnNewTopicAdded);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ async function addToCollection(id) {
|
|||||||
editing.actionAfterFirstSave = {
|
editing.actionAfterFirstSave = {
|
||||||
type: null,
|
type: null,
|
||||||
};
|
};
|
||||||
|
updateEvent({type: Actions.NOTEBOOKS});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'tag': {
|
case 'tag': {
|
||||||
@@ -317,6 +317,7 @@ async function addToCollection(id) {
|
|||||||
type: null,
|
type: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateEvent({type: Actions.TAGS});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'color': {
|
case 'color': {
|
||||||
@@ -325,7 +326,7 @@ async function addToCollection(id) {
|
|||||||
editing.actionAfterFirstSave = {
|
editing.actionAfterFirstSave = {
|
||||||
type: null,
|
type: null,
|
||||||
};
|
};
|
||||||
|
updateEvent({type: Actions.COLORS});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|||||||
Reference in New Issue
Block a user