╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Logout.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
93 { 94 try self.logout(root_focus); 95 return; 96 } 97 } 98 } 99 }, 100 else => {}, 101 } 102 } 103 104 fn logout(self: *View, root_focus: *Focus) !void { 105 self.session.data.user_id = null; 106 // jump focus back to the users tab — the logout button is about to 107 // be hidden by the tab-label swap. 108 try root_focus.setFocus(self.users_tab_id); 109 } 110 111 pub fn clearGrid(self: *View) void { 112 self.center.clearGrid(); 113 } 114 115 pub fn getGrid(self: View) ?Grid { 116 return self.center.getGrid(); 117 } 118 119 pub fn getFocus(self: *View) *Focus { 120 return self.center.getFocus(); 121 } 122 123 pub fn getSelectedIndex(self: View) ?usize { 124 _ = self; 125 return 0; 126 } 127 }; 128