Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(settings): Implement missing calltimer setting #1946

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/src/state/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ pub struct UI {
// stores information related to the current call
#[serde(skip)]
pub call_info: call::CallInfo,
pub call_timer: bool,
#[serde(skip)]
pub current_debug_logger: Option<DebugLogger>,
// false: the media player is anchored in place
Expand Down Expand Up @@ -235,6 +236,7 @@ impl Default for UI {
Self {
notifications: Default::default(),
call_info: Default::default(),
call_timer: true,
current_debug_logger: Default::default(),
popout_media_player: Default::default(),
toast_notifications: Default::default(),
Expand Down
12 changes: 7 additions & 5 deletions ui/src/components/media/calling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,13 @@ fn ActiveCallControl(cx: Scope<ActiveCallProps>) -> Element {
"{participants_name}"
}
)),
p {
class: format_args!("call-time {}", if cx.props.in_chat {"in-chat"} else {""}),
aria_label: "call-time",
format_timestamp_timeago(active_call.answer_time.into(), &state.read().settings.language_id()),
},
state.read().ui.call_timer.then(||rsx!(
p {
class: format_args!("call-time {}", if cx.props.in_chat {"in-chat"} else {""}),
aria_label: "call-time",
format_timestamp_timeago(active_call.answer_time.into(), &state.read().settings.language_id()),
}
)),
cx.props.in_chat.then(||rsx!(div {
class: "self-identity",
UserImage {
Expand Down
7 changes: 6 additions & 1 deletion ui/src/components/settings/sub_pages/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,12 @@ pub fn AudioSettings(cx: Scope) -> Element {
aria_label: "call-timer-section".into(),
section_label: get_local_text("settings-audio.call-timer"),
section_description: get_local_text("settings-audio.call-timer-description"),
Switch {}
Switch {
active: state.read().ui.call_timer,
onflipped: move |e| {
state.write().ui.call_timer = e;
}
}
}
}
))
Expand Down
Loading