fix: 메시지 응답 처리 수정
This commit is contained in:
@@ -187,6 +187,19 @@ const messageIndexedList: Record<MsgType, Ref<MsgItem[]>> = {
|
||||
diplomacy: messageDiplomacy,
|
||||
};
|
||||
|
||||
function processMsg(msg: MsgItem) {
|
||||
if (msg.option.delete) {
|
||||
(() => {
|
||||
const targetID = msg.option.delete;
|
||||
const targetMsg = messageStorage.get(targetID);
|
||||
if(!targetMsg){
|
||||
return;
|
||||
}
|
||||
targetMsg.option.invalid = true;
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
function updateMsgResponse(response: MsgResponse) {
|
||||
if (!response.keepRecent) {
|
||||
messageStorage.clear();
|
||||
@@ -230,6 +243,7 @@ function updateMsgResponse(response: MsgResponse) {
|
||||
if (oldMsg !== undefined) {
|
||||
continue;
|
||||
}
|
||||
processMsg(msg);
|
||||
messageStorage.set(msg.id, msg);
|
||||
filteredMsgList.push(msg);
|
||||
}
|
||||
@@ -602,7 +616,5 @@ onMounted(async () => {
|
||||
.d-grid.Actions {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<button
|
||||
type="button"
|
||||
class="prompt_yes btn_prompt"
|
||||
:disabled="allowButton ? true : undefined"
|
||||
:disabled="allowButton ? undefined : true"
|
||||
@click="tryAccept"
|
||||
>
|
||||
수락
|
||||
@@ -75,7 +75,7 @@
|
||||
<button
|
||||
type="button"
|
||||
class="prompt_no btn_prompt"
|
||||
:disabled="allowButton ? true : undefined"
|
||||
:disabled="allowButton ? undefined : true"
|
||||
@click="tryDecline"
|
||||
>
|
||||
거절
|
||||
|
||||
Reference in New Issue
Block a user