fix(jump-hop): isolate draft runs from public leaderboard
This commit is contained in:
@@ -84,13 +84,18 @@ pub(crate) fn map_jump_hop_leaderboard_procedure_result(
|
||||
pub(crate) fn map_jump_hop_gallery_card_view_row(
|
||||
row: JumpHopGalleryCardViewRow,
|
||||
) -> JumpHopGalleryCardResponse {
|
||||
let theme_text = if row.theme_text.trim().is_empty() {
|
||||
row.work_title.clone()
|
||||
} else {
|
||||
row.theme_text.clone()
|
||||
};
|
||||
JumpHopGalleryCardResponse {
|
||||
public_work_code: row.public_work_code,
|
||||
work_id: row.work_id,
|
||||
profile_id: row.profile_id,
|
||||
owner_user_id: row.owner_user_id,
|
||||
author_display_name: row.author_display_name,
|
||||
theme_text: row.work_title.clone(),
|
||||
theme_text,
|
||||
work_title: row.work_title,
|
||||
work_description: row.work_description,
|
||||
cover_image_src: empty_string_to_none(row.cover_image_src),
|
||||
@@ -125,11 +130,16 @@ fn map_jump_hop_session_snapshot(
|
||||
fn map_jump_hop_work_snapshot(
|
||||
snapshot: JumpHopWorkSnapshot,
|
||||
) -> Result<JumpHopWorkProfileResponse, SpacetimeClientError> {
|
||||
let theme_text = if snapshot.theme_text.trim().is_empty() {
|
||||
snapshot.work_title.clone()
|
||||
} else {
|
||||
snapshot.theme_text.clone()
|
||||
};
|
||||
let draft = JumpHopDraftResponse {
|
||||
template_id: "jump-hop".to_string(),
|
||||
template_name: "跳一跳".to_string(),
|
||||
profile_id: Some(snapshot.profile_id.clone()),
|
||||
theme_text: snapshot.work_title.clone(),
|
||||
theme_text: theme_text.clone(),
|
||||
work_title: snapshot.work_title.clone(),
|
||||
work_description: snapshot.work_description.clone(),
|
||||
theme_tags: snapshot.theme_tags.clone(),
|
||||
@@ -166,7 +176,7 @@ fn map_jump_hop_work_snapshot(
|
||||
profile_id: snapshot.profile_id,
|
||||
owner_user_id: snapshot.owner_user_id,
|
||||
source_session_id: empty_string_to_none(snapshot.source_session_id),
|
||||
theme_text: snapshot.work_title.clone(),
|
||||
theme_text,
|
||||
work_title: snapshot.work_title,
|
||||
work_description: snapshot.work_description,
|
||||
theme_tags: snapshot.theme_tags,
|
||||
@@ -195,7 +205,11 @@ fn map_jump_hop_work_snapshot(
|
||||
}
|
||||
|
||||
fn map_jump_hop_draft_snapshot(snapshot: JumpHopDraftSnapshot) -> JumpHopDraftResponse {
|
||||
let theme_text = snapshot.work_title.clone();
|
||||
let theme_text = if snapshot.theme_text.trim().is_empty() {
|
||||
snapshot.work_title.clone()
|
||||
} else {
|
||||
snapshot.theme_text.clone()
|
||||
};
|
||||
JumpHopDraftResponse {
|
||||
template_id: snapshot.template_id,
|
||||
template_name: snapshot.template_name,
|
||||
|
||||
Reference in New Issue
Block a user