integrate EditProfileView

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-01-03 17:50:48 -05:00
parent 3384d2af14
commit 6645d4880f
7 changed files with 137 additions and 15 deletions

View File

@@ -541,6 +541,11 @@ fn serialize_route(route: &Route, columns: &Columns) -> Option<String> {
selections.push(Selection::Keyword(Keyword::Edit));
selections.push(Selection::Payload(index.to_string()));
}
Route::EditProfile(pubkey) => {
selections.push(Selection::Keyword(Keyword::Profile));
selections.push(Selection::Keyword(Keyword::Edit));
selections.push(Selection::Payload(pubkey.hex()));
}
}
if selections.is_empty() {
@@ -649,6 +654,15 @@ fn selections_to_route(selections: Vec<Selection>) -> Option<CleanIntermediaryRo
Selection::Keyword(Keyword::DeckAuthor) => Some(CleanIntermediaryRoute::ToTimeline(
TimelineKind::profile(PubkeySource::DeckAuthor),
)),
Selection::Keyword(Keyword::Edit) => {
if let Selection::Payload(hex) = selections.get(2)? {
Some(CleanIntermediaryRoute::ToRoute(Route::EditProfile(
Pubkey::from_hex(hex.as_str()).ok()?,
)))
} else {
None
}
}
_ => None,
},
Selection::Keyword(Keyword::Universe) => {