Skip to content

Commit

Permalink
Update and fix startup issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jas-SinghFSU committed Dec 21, 2024
1 parent 3444bde commit f9964f9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HyprPanel 🚀

A panel built for Hyprland with [AGS](https://github.com/Aylur/ags)
A panel built for Hyprland with [Astal](https://github.com/Aylur/astal)

![HyprPanel1](./assets/hp1.png)
![HyprPanel2](./assets/hp2.png)
Expand Down
16 changes: 14 additions & 2 deletions src/components/bar/modules/systray/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ const MenuDefaultIcon = ({ item }: MenuEntryProps): JSX.Element => {
};

const MenuEntry = ({ item, child }: MenuEntryProps): JSX.Element => {
const menu = createMenu(item.menuModel, item.actionGroup);
let menu: Gtk.Menu;

const entryBinding = Variable.derive(
[bind(item, 'menuModel'), bind(item, 'actionGroup')],
(menuModel, actionGroup) => {
if (menuModel && actionGroup) {
menu = createMenu(menuModel, actionGroup);
}
},
);

return (
<button
Expand All @@ -51,7 +60,10 @@ const MenuEntry = ({ item, child }: MenuEntryProps): JSX.Element => {
Notify({ summary: 'App Name', body: item.id });
}
}}
onDestroy={() => menu?.destroy()}
onDestroy={() => {
menu?.destroy();
entryBinding.drop();
}}
>
{child}
</button>
Expand Down
4 changes: 3 additions & 1 deletion src/components/menus/bluetooth/devices/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { bluetoothService } from 'src/lib/constants/services';
* @returns An array of available Bluetooth devices.
*/
export const getAvailableBluetoothDevices = (): AstalBluetooth.Device[] => {
const availableDevices = bluetoothService.devices
const bluetoothDevices = bluetoothService.get_devices() ?? [];

const availableDevices = bluetoothDevices
.filter((btDev) => btDev.name !== null)
.sort((a, b) => {
if (a.connected || a.paired) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/menus/network/wifi/WirelessAPs/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const dedupeWAPs = (): AstalNetwork.AccessPoint[] => {
return [];
}

const WAPs = networkService.wifi.accessPoints;
const WAPs = networkService.wifi.get_access_points();
const dedupMap: Record<string, AstalNetwork.AccessPoint> = {};

WAPs.forEach((item: AstalNetwork.AccessPoint) => {
Expand Down

0 comments on commit f9964f9

Please sign in to comment.