Skip to content

Commit

Permalink
feat: allow logging out when there is no token
Browse files Browse the repository at this point in the history
  • Loading branch information
vixalien committed Nov 14, 2024
1 parent 67afe41 commit d193a0f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/layout/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ export class WindowSidebar extends Adw.Bin {
console.error("Couldn't get logged in user");
});

if (!account) return;

const menu = Gio.Menu.new();

menu.append(
account.name,
`navigator.visit("muzika:channel:${account.channel_id}")`,
);
if (account) {
menu.append(
account.name,
`navigator.visit("muzika:channel:${account.channel_id}")`,
);
}

menu.append(_("Logout"), "win.logout");

this._account.menu_model = menu;
Expand Down

0 comments on commit d193a0f

Please sign in to comment.