Link support 1/2
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 59s

This commit is contained in:
2026-05-03 01:02:13 +02:00
parent 030060286f
commit 94e2b8bd47
6 changed files with 71 additions and 169 deletions

View File

@@ -10,12 +10,30 @@ const campaignName = computed(() => {
return Campaign.value?.name ?? 'Campaign';
});
function openCreateNoteWindow() {
async function createNote() {
if (!Campaign.value) {
return;
}
CreateWindow('create_note');
const campaignId = Campaign.value?._id
try {
const response = await Server().post('/note/create', {
title: 'New note',
content: content.value,
campaign: campaignId
});
if (response.data.status !== 'ok') {
return;
}
emitter.emit('note-created', response.data.note);
} catch (err) {
error.value = 'Unable to create note.';
} finally {
isSaving.value = false;
}
}
function exitToMainMenu() {
@@ -42,7 +60,7 @@ function exitToMainMenu() {
<img class="top-bar-button-icon" src="/icons/iconoir/regular/nav-arrow-left.svg" alt="" aria-hidden="true">
<span>Main Menu</span>
</button>
<button class="note-button sound-click" type="button" @click="openCreateNoteWindow" :disabled="!Campaign">
<button class="note-button sound-click" type="button" @click="createNote" :disabled="!Campaign">
<img class="note-button-icon" src="/icons/iconoir/regular/plus.svg" alt="" aria-hidden="true">
<span>New Note</span>
</button>

View File

@@ -171,7 +171,7 @@ onMounted(() => {
.roll-btn {
padding: 8px;
margin-right: 4px;
margin-right: 8px;
}
</style>