fix: 메시지 응답 처리 수정
This commit is contained in:
@@ -187,6 +187,19 @@ const messageIndexedList: Record<MsgType, Ref<MsgItem[]>> = {
|
|||||||
diplomacy: messageDiplomacy,
|
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) {
|
function updateMsgResponse(response: MsgResponse) {
|
||||||
if (!response.keepRecent) {
|
if (!response.keepRecent) {
|
||||||
messageStorage.clear();
|
messageStorage.clear();
|
||||||
@@ -230,6 +243,7 @@ function updateMsgResponse(response: MsgResponse) {
|
|||||||
if (oldMsg !== undefined) {
|
if (oldMsg !== undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
processMsg(msg);
|
||||||
messageStorage.set(msg.id, msg);
|
messageStorage.set(msg.id, msg);
|
||||||
filteredMsgList.push(msg);
|
filteredMsgList.push(msg);
|
||||||
}
|
}
|
||||||
@@ -461,7 +475,7 @@ function foldMessage($event: MouseEvent, type: MsgType) {
|
|||||||
const remain = target.slice(10);
|
const remain = target.slice(10);
|
||||||
target.length = 10;
|
target.length = 10;
|
||||||
|
|
||||||
for(const msg of remain){
|
for (const msg of remain) {
|
||||||
messageStorage.delete(msg.id);
|
messageStorage.delete(msg.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -574,7 +588,7 @@ onMounted(async () => {
|
|||||||
border-right: 1px solid gray;
|
border-right: 1px solid gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
.only-mobile{
|
.only-mobile {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -602,7 +616,5 @@ onMounted(async () => {
|
|||||||
.d-grid.Actions {
|
.d-grid.Actions {
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="prompt_yes btn_prompt"
|
class="prompt_yes btn_prompt"
|
||||||
:disabled="allowButton ? true : undefined"
|
:disabled="allowButton ? undefined : true"
|
||||||
@click="tryAccept"
|
@click="tryAccept"
|
||||||
>
|
>
|
||||||
수락
|
수락
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="prompt_no btn_prompt"
|
class="prompt_no btn_prompt"
|
||||||
:disabled="allowButton ? true : undefined"
|
:disabled="allowButton ? undefined : true"
|
||||||
@click="tryDecline"
|
@click="tryDecline"
|
||||||
>
|
>
|
||||||
거절
|
거절
|
||||||
|
|||||||
Reference in New Issue
Block a user