╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────╮ │19 repos: []const evt.Repo, │ │20 settings: Settings, │ │21 auth: Auth, │ │22 +route_name: ui.RoutablePage.Array(evt.User.name_max_len),│ │23 │ │24 const Self = @This(); │ │25 │ ╰─────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────╮ │26 pub fn init( │ │27 arena: *std.heap.ArenaAllocator, │ │28 haxy_moment: evt.AdminDB.HashMap(.read_only), │ │28 - name: []const u8, │ │29 + name: ui.RoutablePage.Array(evt.User.name_max_len),│ │30 ) !Self { │ │31 const DB = evt.AdminDB; │ │32 const hash_kind = evt.admin_repo_opts.hash; │ ╰───────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │35 // the name->user-id index, which everything below keys off of. │ │36 const name_to_user_id_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, "name->user-id")) orelse return error.NotFound;│ │37 const name_to_user_id = try DB.HashMap(.read_only).init(name_to_user_id_cursor); │ │37 - const user_id_cursor = try name_to_user_id.getCursor(hash.hashInt(hash_kind, name)) orelse return error.NotFound; │ │38 + const user_id_cursor = try name_to_user_id.getCursor(hash.hashInt(hash_kind, name.slice())) orelse return error.NotFound; │ │39 var user_id_buf: [evt.event_id_size]u8 = undefined; │ │40 _ = try user_id_cursor.readBytes(&user_id_buf); │ │41 const user_id: []const u8 = &user_id_buf; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────╮ │72 .repos = repos.items, │ │73 .settings = Settings.init(),│ │74 .auth = Auth.init(), │ │75 + .route_name = name, │ │76 }; │ │77 } │ │78 │ ╰────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │155 // rather than navigating. │ │156 if (header.getSelectedIndex()) |index| { │ │157 stack.getFocus().child_id = stack.children.keys()[index];│ │156 - const name = self.data.user.name; │ │158 + const name = self.data.route_name; │ │159 self.session.data.current_page = switch (index) { │ │160 1 => .{ .user_settings = name }, │ │161 2 => .{ .user_auth = name }, │ ╰──────────────────────────────────────────────────────────────────────────╯