mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-21 22:58:10 +00:00
fix(api): remove group in groupMap
after quit
This commit is contained in:
parent
bc238645b4
commit
e5b907d155
@ -205,7 +205,7 @@ const responseDispatcher = async (
|
|||||||
|
|
||||||
case 'onGroupListUpdate':
|
case 'onGroupListUpdate':
|
||||||
case 'nodeIKernelGroupListener/onGroupListUpdate': {
|
case 'nodeIKernelGroupListener/onGroupListUpdate': {
|
||||||
const { groupList } = payload as OnGroupListUpdate
|
const { groupList, updateType } = payload as OnGroupListUpdate
|
||||||
|
|
||||||
for (const group of groupList) {
|
for (const group of groupList) {
|
||||||
ctx.chronocatEngineChronocatApi.msgBoxActiv.activate({
|
ctx.chronocatEngineChronocatApi.msgBoxActiv.activate({
|
||||||
@ -214,7 +214,9 @@ const responseDispatcher = async (
|
|||||||
guildId: '',
|
guildId: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
groupMap[group.groupCode] = group
|
if (updateType === 1) groupMap[group.groupCode] = group
|
||||||
|
else if (updateType === 3)
|
||||||
|
if (groupMap[group.groupCode]) delete groupMap[group.groupCode]
|
||||||
}
|
}
|
||||||
|
|
||||||
chronoEventEmitter.emitGroupListUpdate()
|
chronoEventEmitter.emitGroupListUpdate()
|
||||||
|
@ -104,7 +104,11 @@ export interface OnEmojiDownloadComplete {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface OnGroupListUpdate {
|
export interface OnGroupListUpdate {
|
||||||
updateType: 1
|
/**
|
||||||
|
* 1 为增加,3 为退出。
|
||||||
|
*/
|
||||||
|
updateType: 1 | 3
|
||||||
|
|
||||||
groupList: Group[]
|
groupList: Group[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user