Eternal
Eternal
Explore posts from servers
NNuxt
Created by Eternal on 4/27/2025 in #❓・help
Update variable on UInput change
Please ping me when you respond
25 replies
NNuxt
Created by Eternal on 4/27/2025 in #❓・help
Update variable on UInput change
It works when using a ref but it doesn't work when using a reactive
25 replies
NNuxt
Created by Eternal on 4/27/2025 in #❓・help
Update variable on UInput change
This issue has not been solved
25 replies
NNuxt
Created by Eternal on 4/27/2025 in #❓・help
Update variable on UInput change
@kapa.ai Code for reproduction:
<script setup>
import * as z from 'zod'
const modifyAnnouncementForm = z.object({
calendarEventId: z.union([z.number(), z.null()]),
});
type ModifyAnnouncementForm = z.output<typeof modifyAnnouncementForm>;

const modifyingAnnouncementFormState =
reactive<
ModifyAnnouncementForm >
{
calendarEventId: null,
};
const openModifyModal = ref(false);

watch(() => modifyingAnnouncementFormState.calendarEventId, (newValue) => {
console.log(newValue)
});
</script>

<template>
<UModal
v-model:open="openModifyModal"
:title="`Modifying &quot;${modifyingAnnouncementFormState.title}&quot;`"
:ui="{ footer: 'justify-end' }"
:close="{
color: 'error',
variant: 'subtle',
class: 'rounded-full',
}"
>
<template #body>
<UForm
:schema="modifyAnnouncementForm"
:state="modifyingAnnouncementFormState"
class="space-y-4"
>
<div class="calendarEvent">
<UFormField label="Calendar Event ID" name="calendarEventId">
<UInput
v-model="modifyingAnnouncementFormState.calendarEventId"
type="number"
/>
</UFormField>

<UCard variant="subtle" class="calendarEventDetails">
<template #header>
<h1>{{ modifyingAnnouncementFormState.calendarEventId }}</h1>
</template>
</UCard>
</div>

<UButton type="submit"> Submit </UButton>
</UForm>
</template>
</UModal>
</template>
<script setup>
import * as z from 'zod'
const modifyAnnouncementForm = z.object({
calendarEventId: z.union([z.number(), z.null()]),
});
type ModifyAnnouncementForm = z.output<typeof modifyAnnouncementForm>;

const modifyingAnnouncementFormState =
reactive<
ModifyAnnouncementForm >
{
calendarEventId: null,
};
const openModifyModal = ref(false);

watch(() => modifyingAnnouncementFormState.calendarEventId, (newValue) => {
console.log(newValue)
});
</script>

<template>
<UModal
v-model:open="openModifyModal"
:title="`Modifying &quot;${modifyingAnnouncementFormState.title}&quot;`"
:ui="{ footer: 'justify-end' }"
:close="{
color: 'error',
variant: 'subtle',
class: 'rounded-full',
}"
>
<template #body>
<UForm
:schema="modifyAnnouncementForm"
:state="modifyingAnnouncementFormState"
class="space-y-4"
>
<div class="calendarEvent">
<UFormField label="Calendar Event ID" name="calendarEventId">
<UInput
v-model="modifyingAnnouncementFormState.calendarEventId"
type="number"
/>
</UFormField>

<UCard variant="subtle" class="calendarEventDetails">
<template #header>
<h1>{{ modifyingAnnouncementFormState.calendarEventId }}</h1>
</template>
</UCard>
</div>

<UButton type="submit"> Submit </UButton>
</UForm>
</template>
</UModal>
</template>
25 replies
NNuxt
Created by Eternal on 4/27/2025 in #❓・help
Update variable on UInput change
@kapa.ai It doesn't work even if I use a getter for watching a reactive
25 replies
NNuxt
Created by Eternal on 4/27/2025 in #❓・help
Update variable on UInput change
@kapa.ai It only works if the variable I'm watching is a ref, not a reactive
25 replies
NNuxt
Created by Eternal on 4/27/2025 in #❓・help
Update variable on UInput change
@kapa.ai Why doesn't attaching a watch() work? The value updates now, but watch doesn't do anything
watch(modifyingAnnouncementFormState.calendarEventId, (newValue, oldValue) => {
console.log(newValue)
})
watch(modifyingAnnouncementFormState.calendarEventId, (newValue, oldValue) => {
console.log(newValue)
})
25 replies
HHono
Created by shcwork on 4/18/2025 in #help
RPC client shows 'any'
you should mark the thread as "solved" btw
8 replies
TTCTheo's Typesafe Cult
Created by Eternal on 8/25/2024 in #questions
Should the server respond with the error or a generic "try again" message?
Ooh. I'm gunna do that except with a webhook
10 replies
TTCTheo's Typesafe Cult
Created by Eternal on 8/25/2024 in #questions
Should the server respond with the error or a generic "try again" message?
Logging all errors to the database or to a file? I didn't think of that before. Great idea.
10 replies
NNuxt
Created by Eternal on 5/26/2024 in #❓・help
UI not changing when ref variable changes
<template>
<button @click="toggleRobloxAccounts" class="activeAccount">
<div class="wrapper">
<img :src="robloxAccount.profilePicture" :alt="robloxAccount.username" ref="robloxAccountImage">
<p ref="robloxAccountUsername">{{ robloxAccount.username }}</p>
</div>
<Icon name="fa-solid:chevron-down" />
</button>
<div v-show="showRobloxAccounts" class="reserveRobloxAccounts">
<button v-for="account in reserveRobloxAccounts" :key="account.robloxId"
@click="setActiveAccount(account.robloxId)">
<div class="wrapper">
<NuxtImg :src="account.profilePicture" :alt="account.username" format="avif"
draggable="false" />
<p>{{ account.username }}</p>
</div>
</button>
</div>
</template>
<template>
<button @click="toggleRobloxAccounts" class="activeAccount">
<div class="wrapper">
<img :src="robloxAccount.profilePicture" :alt="robloxAccount.username" ref="robloxAccountImage">
<p ref="robloxAccountUsername">{{ robloxAccount.username }}</p>
</div>
<Icon name="fa-solid:chevron-down" />
</button>
<div v-show="showRobloxAccounts" class="reserveRobloxAccounts">
<button v-for="account in reserveRobloxAccounts" :key="account.robloxId"
@click="setActiveAccount(account.robloxId)">
<div class="wrapper">
<NuxtImg :src="account.profilePicture" :alt="account.username" format="avif"
draggable="false" />
<p>{{ account.username }}</p>
</div>
</button>
</div>
</template>
The userDataStore is a Pinia store
3 replies
NNuxt
Created by Eternal on 5/26/2024 in #❓・help
UI not changing when ref variable changes
Here's my code if you want to take a look
<script>
const showRobloxAccounts = ref(false);
function toggleRobloxAccounts() {
showRobloxAccounts.value = !showRobloxAccounts.value;
}


const robloxAccount = ref<{ username: string, robloxId: number, profilePicture: string }>({
username: "",
robloxId: 0,
profilePicture: ""
});
const reserveRobloxAccounts = ref<username: string, robloxId: number, profilePicture: string[]>([]);

function setActiveAccount(robloxId: number) {
for (let i = 0; i < reserveRobloxAccounts.value.length; i++) {
if (reserveRobloxAccounts.value[i].robloxId == robloxId) {
const temp = reserveRobloxAccounts.value[i];
reserveRobloxAccounts.value.splice(i, 1);
console.log(robloxAccount.value)
reserveRobloxAccounts.value.push(robloxAccount.value);
robloxAccount.value = {
username: temp.username,
robloxId: temp.robloxId,
profilePicture: temp.profilePicture,
};
console.log(robloxAccount.value)
break;
}
}
}

watch(userDataStore, (data) => {
robloxAccount.value = data.robloxAccount;
reserveRobloxAccounts.value = data.reserveRobloxAccounts;
});

watch(robloxAccount, (data) => {
console.log("hello world"); //this doesnt run after you change the robloxAccount variable in the setActiveAccount function.
});
</script>
<script>
const showRobloxAccounts = ref(false);
function toggleRobloxAccounts() {
showRobloxAccounts.value = !showRobloxAccounts.value;
}


const robloxAccount = ref<{ username: string, robloxId: number, profilePicture: string }>({
username: "",
robloxId: 0,
profilePicture: ""
});
const reserveRobloxAccounts = ref<username: string, robloxId: number, profilePicture: string[]>([]);

function setActiveAccount(robloxId: number) {
for (let i = 0; i < reserveRobloxAccounts.value.length; i++) {
if (reserveRobloxAccounts.value[i].robloxId == robloxId) {
const temp = reserveRobloxAccounts.value[i];
reserveRobloxAccounts.value.splice(i, 1);
console.log(robloxAccount.value)
reserveRobloxAccounts.value.push(robloxAccount.value);
robloxAccount.value = {
username: temp.username,
robloxId: temp.robloxId,
profilePicture: temp.profilePicture,
};
console.log(robloxAccount.value)
break;
}
}
}

watch(userDataStore, (data) => {
robloxAccount.value = data.robloxAccount;
reserveRobloxAccounts.value = data.reserveRobloxAccounts;
});

watch(robloxAccount, (data) => {
console.log("hello world"); //this doesnt run after you change the robloxAccount variable in the setActiveAccount function.
});
</script>
3 replies
DIAdiscord.js - Imagine an app
Created by 🧋 on 4/2/2024 in #djs-questions
I need help with this error
The error is happending because libuuid.so cant be found Judging by the name, i assume libuuid is used fir generating uuid's. You should open an issue with the package youre using on their github
7 replies
DIAdiscord.js - Imagine an app
Created by 🧋 on 4/2/2024 in #djs-questions
I need help with this error
This isnt a d.js related issue
7 replies
DIAdiscord.js - Imagine an app
Created by black on 4/2/2024 in #djs-questions
Unknown interaction, sometimes
You could run "ping" in the background and watch for spikes in ping. When thr bot crashes, you can look at the ping logs to see if there was a massive spike in ping or not
20 replies
NNuxt
Created by Eternal on 3/19/2024 in #❓・help
how to configure tree shaking
Adding Nuxt UI adds a whole 0.5 mb of code even if i only use dropdowns and nothing else
2 replies
TTCTheo's Typesafe Cult
Created by Eternal on 3/15/2024 in #questions
rolling your own auth
Thanks
5 replies
TTCTheo's Typesafe Cult
Created by techhjork on 5/20/2023 in #questions
Credentials Signin NextJs
6 replies
TTCTheo's Typesafe Cult
Created by techhjork on 5/20/2023 in #questions
Credentials Signin NextJs
It says which GitHub issue to check in the error message
6 replies
TTCTheo's Typesafe Cult
Created by Giacomo on 5/20/2023 in #questions
Simple server solution when serverless is not enough
Now I'm Theo, or even an intern. But if I had this problem and I was hell bent on keeping server less in there, Id have a server always running. Server less sends post request to that server, like you suggested yourself. One problem would be fear of someone finding that server on shodan or whatever. So use an auth header? Don't have to be complex. Idk, that's just my two cents.
4 replies