Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
azymohliad committed Feb 4, 2023
1 parent d2537ab commit 0467878
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/infinitime/freedesktop/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ pub async fn run_notification_session(infinitime: &bt::InfiniTime) -> Result<()>
// except one has hints["sender-pid"] as U32 and another one as I64, so we
// can deduplicate them by filtering out one of these types.
// TODO: Find proper solution.
if let Some(Value::I64(_)) = notification.hints.get("sender-pid") {
if let Some(Value::U32(_)) = notification.hints.get("sender-pid") {
continue;
}

if infinitime.is_upgrading_firmware() {
continue;
}
Expand Down
10 changes: 8 additions & 2 deletions src/ui/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,14 @@ impl Component for Model {
let mut devices_guard = self.devices.guard();
for i in (0..devices_guard.len()).rev() {
if let Some(device) = devices_guard.get(i) {
// Preserve connected and transitioning devices on the list
if device.address == address && device.state == DeviceState::Disconnected {
if device.address == address {
// Temporary hack to prevent removing devices
// while they're being manually disconnected.
// TODO: Ask bluer maintainers if the adapter is supposed to
// sends AdapterEvent::DeviceRemoved event when disconnecting,
// or if it is a bug
if device.state == DeviceState::Transitioning { continue; }

devices_guard.remove(i);
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/ui/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ impl Model {
command: `flatpak override --socket=session-bus io.gitlab.azymohliad.WatchMate`, \
or via Flatseal"
);
_ = sender.output(Output::Toast(
"Notifications require full D-Bus session bus access.\n\
Please grant it via Flatseal or `flatpak override`"
));
_ = sender.output(Output::Toast("Notifications require D-Bus session bus permission"));
} else {
log::warn!("Notifications session failed: {error}");
_ = sender.output(Output::Toast("Notification session failed"));
Expand Down

0 comments on commit 0467878

Please sign in to comment.