mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: Add idle detection to collaboration feature (#2877)
* Start idle detection implementation * First working version * Add screen state * Add type safety * Better rendering, enum types, localization * Add origin trial token * Fix * Refactor idle detection to no longer use IdleDetector API * Cleanup some leftovers * Fix * Apply suggestions from code review * Three state: active 🟢, idle 💤, away ⚫️ * Address feedback from code review Thanks, @lipis * Deal with unmount Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
This commit is contained in:
parent
15f698dc21
commit
1837147c55
11 changed files with 156 additions and 6 deletions
|
@ -46,6 +46,7 @@ export enum EVENT {
|
|||
TOUCH_START = "touchstart",
|
||||
TOUCH_END = "touchend",
|
||||
HASHCHANGE = "hashchange",
|
||||
VISIBILITY_CHANGE = "visibilitychange",
|
||||
}
|
||||
|
||||
export const ENV = {
|
||||
|
@ -93,3 +94,8 @@ export const TOAST_TIMEOUT = 5000;
|
|||
export const VERSION_TIMEOUT = 30000;
|
||||
|
||||
export const ZOOM_STEP = 0.1;
|
||||
|
||||
// Report a user inactive after IDLE_THRESHOLD milliseconds
|
||||
export const IDLE_THRESHOLD = 60_000;
|
||||
// Report a user active each ACTIVE_THRESHOLD milliseconds
|
||||
export const ACTIVE_THRESHOLD = 3_000;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue