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:
@ -4,6 +4,7 @@ import { ImportedDataState } from "../../data/types";
|
||||
import { ExcalidrawElement } from "../../element/types";
|
||||
import { t } from "../../i18n";
|
||||
import { AppState } from "../../types";
|
||||
import { UserIdleState } from "../collab/types";
|
||||
|
||||
const byteToHex = (byte: number): string => `0${byte.toString(16)}`.slice(-2);
|
||||
|
||||
@ -59,6 +60,14 @@ export type SocketUpdateDataSource = {
|
||||
username: string;
|
||||
};
|
||||
};
|
||||
IDLE_STATUS: {
|
||||
type: "IDLE_STATUS";
|
||||
payload: {
|
||||
socketId: string;
|
||||
userState: UserIdleState;
|
||||
username: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export type SocketUpdateDataIncoming =
|
||||
|
Reference in New Issue
Block a user