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);
|
||||
}
|
||||
@@ -461,7 +475,7 @@ function foldMessage($event: MouseEvent, type: MsgType) {
|
||||
const remain = target.slice(10);
|
||||
target.length = 10;
|
||||
|
||||
for(const msg of remain){
|
||||
for (const msg of remain) {
|
||||
messageStorage.delete(msg.id);
|
||||
}
|
||||
}
|
||||
@@ -574,7 +588,7 @@ onMounted(async () => {
|
||||
border-right: 1px solid gray;
|
||||
}
|
||||
|
||||
.only-mobile{
|
||||
.only-mobile {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -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