malekim / v-idle

A Vue.js plugin to detect idle/non-active users
https://malekim.github.io/v-idle/
MIT License
70 stars 8 forks source link

Event on-active #31

Closed Kuro-dev closed 4 months ago

Kuro-dev commented 2 years ago

I want to automatically log a user out if they are idle for too long. for that i want to show a small popup that lets them know in advance. Now i would also like to automatically dismiss this notification in the case that the user does something again.

malekim commented 2 years ago

This is what for you've got @remindand :reminders. You can use it to show the modal. Currently in the plugin there is event sent on active, but you can easily implement this with window.addEventListener. Just remember to clear it in beforeDestroy with `window.removeEventListener.

deidyomega commented 4 months ago

@Kuro-dev You can now do this using refresh callback

<v-idle @refresh="onrefresh" />

function onrefresh() { console.log("user did something") }