Fix area exploration on workots
This commit is contained in:
@@ -53,7 +53,7 @@ const staticActivityTypes = [
|
|||||||
|
|
||||||
const stringifyActivity = chain<[Activity], Activity, string>(
|
const stringifyActivity = chain<[Activity], Activity, string>(
|
||||||
(activity) => {
|
(activity) => {
|
||||||
if (movingActivityTypes.includes(activity.type)) {
|
if (movingActivityTypes.includes(activity.sport_type)) {
|
||||||
return omit(activity, [
|
return omit(activity, [
|
||||||
"laps",
|
"laps",
|
||||||
"splits_metric",
|
"splits_metric",
|
||||||
@@ -70,7 +70,7 @@ const stringifyActivity = chain<[Activity], Activity, string>(
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (staticActivityTypes.includes(activity.type)) {
|
if (staticActivityTypes.includes(activity.sport_type)) {
|
||||||
return omit(activity, [
|
return omit(activity, [
|
||||||
"laps",
|
"laps",
|
||||||
"splits_metric",
|
"splits_metric",
|
||||||
@@ -124,23 +124,28 @@ export const createActivityContent = async ({
|
|||||||
const highlight = isEmpty(user.preferences.data?.highlights)
|
const highlight = isEmpty(user.preferences.data?.highlights)
|
||||||
? (draw(availableHighlights) as string)
|
? (draw(availableHighlights) as string)
|
||||||
: draw(user.preferences.data!.highlights!);
|
: draw(user.preferences.data!.highlights!);
|
||||||
const highlightInstructions = match(highlight)
|
const highlightInstructions = match({ highlight, activity: currentActivity })
|
||||||
.with(
|
.when(
|
||||||
"Athletic",
|
({ highlight, activity }) =>
|
||||||
() =>
|
highlight === "Area Exploration" &&
|
||||||
"Highlight athletic properties and performance. Highlight PR's as well only if available.",
|
movingActivityTypes.includes(get(activity, "sport_type")),
|
||||||
|
() => "Highlight places visited and areas explored.",
|
||||||
)
|
)
|
||||||
.with("Area Exploration", () => "Highlight area exploration properties.")
|
|
||||||
.with(
|
.with(
|
||||||
"Social",
|
{ highlight: "Athletic" },
|
||||||
|
() =>
|
||||||
|
"Highlight athletic properties and performance. Highlight PR's as well but only if available.",
|
||||||
|
)
|
||||||
|
.with(
|
||||||
|
{ highlight: "Social" },
|
||||||
() =>
|
() =>
|
||||||
"Highlight social properties such as friend participation and activities.",
|
"Highlight social properties such as friend participation and activities.",
|
||||||
)
|
)
|
||||||
.with(
|
.with(
|
||||||
"Mood",
|
{ highlight: "Mood" },
|
||||||
() => "Highlight on how mood was swinging through the activity.",
|
() => "Highlight how mood was swinging through the activity.",
|
||||||
)
|
)
|
||||||
.with("Conditions", () => "Highlight on weather conditions");
|
.with({ highlight: "Conditions" }, () => "Highlight on weather conditions");
|
||||||
|
|
||||||
const length = match({ tone })
|
const length = match({ tone })
|
||||||
.with({ tone: "Minimalist" }, () => "short")
|
.with({ tone: "Minimalist" }, () => "short")
|
||||||
|
|||||||
Reference in New Issue
Block a user