Complete instant diplomacy response parity

This commit is contained in:
2026-07-26 03:10:41 +00:00
parent b3f4734e80
commit 9885bf6905
23 changed files with 2072 additions and 305 deletions
+21 -1
View File
@@ -235,6 +235,26 @@ export const useMainDashboardStore = defineStore('mainDashboard', () => {
}
};
const respondToMessage = async (messageId: number, response: boolean) => {
const id = generalId.value;
if (!id) {
return;
}
try {
const result = await trpc.messages.respond.mutate({
generalId: id,
messageId,
response,
});
if (!result.result) {
error.value = result.reason;
}
await refreshMessages();
} catch (err) {
error.value = resolveErrorMessage(err);
}
};
const setGeneralTurn = async (turnIndex: number, action: string) => {
const id = generalId.value;
if (!id) {
@@ -311,7 +331,6 @@ export const useMainDashboardStore = defineStore('mainDashboard', () => {
}
};
let realtimeSource: EventSource | null = null;
let realtimeToken: string | null = null;
@@ -472,6 +491,7 @@ export const useMainDashboardStore = defineStore('mainDashboard', () => {
refreshMessages,
sendMessage,
loadOlderMessages,
respondToMessage,
setGeneralTurn,
shiftGeneralTurns,
setNationTurn,