#Listen in typescript and call from rust
29 messages · Page 1 of 1 (latest)
but how do i call it on the rust side?
A webview window managed by Tauri.
using vue it crashes xd
and i cant even see the log lmao
i have this:
const focusInput = await listen<string>("focus", (event) => {
console.log("Entrou no input")
})
what crashed? backend or only frontend?
so window still exists?
hm maybe i should unhide to debug this. it starts hidden by default
stays on the tray
or listen after unhide
3 days on the same app has been killing me lmao
cant even do simple things
@proud latch @visual grotto have you ever needed to do this? The only place that its not crashing is onMounted but then it's not listenting. The console.log won't trigger
and the window crashes otherwise
Had to do what, listening in the frontend then emitting events from the Rust side?
yeah
async mounted() {
const self = this
self.unlisten = await listen('system_state_update', (event) => {
self.systemState = event.payload
})
await invoke('setup')
}
dont know what i did but it worked this time
lmao
Always love when that happens x)
i think i know why
i created a const with a ref this time
instead of creating it onmount
probably that was it