ui: inform guests of restricted interfaces
This commit is contained in:
parent
1f922f8221
commit
39750c1d82
8 changed files with 137 additions and 49 deletions
|
|
@ -56,10 +56,14 @@ pub fn RealmSceneViewer(
|
|||
/// Current user's guest_session_id (for context menu filtering).
|
||||
#[prop(optional, into)]
|
||||
current_guest_session_id: Option<Signal<Option<Uuid>>>,
|
||||
/// Whether the current user is a guest (guests cannot use context menu).
|
||||
#[prop(optional, into)]
|
||||
is_guest: Option<Signal<bool>>,
|
||||
/// Callback when whisper is requested on a member.
|
||||
#[prop(optional, into)]
|
||||
on_whisper_request: Option<Callback<String>>,
|
||||
) -> impl IntoView {
|
||||
let is_guest = is_guest.unwrap_or_else(|| Signal::derive(|| false));
|
||||
// Use default settings if none provided
|
||||
let settings = settings.unwrap_or_else(|| Signal::derive(ViewerSettings::default));
|
||||
let dimensions = parse_bounds_dimensions(&scene.bounds_wkt);
|
||||
|
|
@ -183,14 +187,19 @@ pub fn RealmSceneViewer(
|
|||
move |ev: web_sys::MouseEvent| {
|
||||
use wasm_bindgen::JsCast;
|
||||
|
||||
// Get click position
|
||||
let client_x = ev.client_x() as f64;
|
||||
let client_y = ev.client_y() as f64;
|
||||
// Guests cannot message other users - don't show context menu
|
||||
if is_guest.get() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get current user identity for filtering
|
||||
let my_user_id = current_user_id.map(|s| s.get()).flatten();
|
||||
let my_guest_session_id = current_guest_session_id.map(|s| s.get()).flatten();
|
||||
|
||||
// Get click position
|
||||
let client_x = ev.client_x() as f64;
|
||||
let client_y = ev.client_y() as f64;
|
||||
|
||||
// Query all avatar canvases and check for hit
|
||||
let document = web_sys::window().unwrap().document().unwrap();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue