KeywordNotify: Update
This commit is contained in:
parent
f8e6b14024
commit
96e04c0e7b
1 changed files with 7 additions and 6 deletions
|
|
@ -371,14 +371,14 @@ export default definePlugin({
|
||||||
return this.modify(e);
|
return this.modify(e);
|
||||||
};
|
};
|
||||||
|
|
||||||
FluxDispatcher.subscribe("MESSAGE_CREATE", interceptor);
|
FluxDispatcher.addInterceptor(interceptor);
|
||||||
FluxDispatcher.subscribe("MESSAGE_UPDATE", interceptor);
|
|
||||||
FluxDispatcher.subscribe("LOAD_MESSAGES_SUCCESS", interceptor);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
FluxDispatcher.unsubscribe("MESSAGE_CREATE", interceptor);
|
const index = FluxDispatcher._interceptors.indexOf(interceptor);
|
||||||
FluxDispatcher.unsubscribe("MESSAGE_UPDATE", interceptor);
|
if (index > -1) {
|
||||||
FluxDispatcher.unsubscribe("LOAD_MESSAGES_SUCCESS", interceptor);
|
FluxDispatcher._interceptors.splice(index, 1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
applyKeywordEntries(m: Message) {
|
applyKeywordEntries(m: Message) {
|
||||||
|
|
@ -475,6 +475,7 @@ export default definePlugin({
|
||||||
try {
|
try {
|
||||||
messageRecord = createMessageRecord(m);
|
messageRecord = createMessageRecord(m);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue