feat(active-workout): require paired Watch to start workout
This commit is contained in:
@@ -40,12 +40,7 @@ export function PreSwimScreen() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleStartSwim = async () => {
|
const handleStartSwim = async () => {
|
||||||
if (!workout) return;
|
if (!workout || !isReady) return;
|
||||||
|
|
||||||
if (!isReady) {
|
|
||||||
navigation.navigate("PostSwim", { workoutId: route.params.workoutId });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await sendWorkoutToWatch(
|
const result = await sendWorkoutToWatch(
|
||||||
workout.id,
|
workout.id,
|
||||||
@@ -101,10 +96,10 @@ export function PreSwimScreen() {
|
|||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={() => navigation.navigate("PostSwim", { workoutId: route.params.workoutId })}
|
onPress={() => setSyncResult(null)}
|
||||||
className="bg-sky-500 rounded-2xl py-4 items-center w-full"
|
className="bg-sky-500 rounded-2xl py-4 items-center w-full"
|
||||||
>
|
>
|
||||||
<Text className="text-white font-bold text-lg">{t("startWithoutWatch")}</Text>
|
<Text className="text-white font-bold text-lg">{tc("retry")}</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
@@ -172,25 +167,25 @@ export function PreSwimScreen() {
|
|||||||
|
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={handleStartSwim}
|
onPress={handleStartSwim}
|
||||||
disabled={isSyncing}
|
disabled={isSyncing || !isReady}
|
||||||
className={`rounded-2xl py-4 items-center ${
|
className={`rounded-2xl py-4 items-center ${
|
||||||
isSyncing ? "bg-sky-300" : "bg-sky-500"
|
isSyncing || !isReady ? "bg-slate-300" : "bg-sky-500"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{isSyncing ? (
|
{isSyncing ? (
|
||||||
<ActivityIndicator color="#fff" />
|
<ActivityIndicator color="#fff" />
|
||||||
) : (
|
) : (
|
||||||
<Text className="text-white font-bold text-lg">
|
<Text className={`font-bold text-lg ${!isReady ? "text-slate-500" : "text-white"}`}>
|
||||||
{isReady ? t("sendToWatchAndStart") : t("startWithoutWatch")}
|
{t("sendToWatchAndStart")}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|
||||||
<Text className="text-slate-400 text-xs text-center mt-3">
|
{!isReady && (
|
||||||
{isReady
|
<Text className="text-red-500 text-xs text-center mt-3">
|
||||||
? t("syncToWatch")
|
{t("watchRequired")}
|
||||||
: t("trackedOnDevice")}
|
</Text>
|
||||||
</Text>
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Öffne die SwimBuddy-App auf deiner Watch, um mit der Verfolgung zu beginnen.",
|
"openWatchApp": "Öffne die SwimBuddy-App auf deiner Watch, um mit der Verfolgung zu beginnen.",
|
||||||
"failedToSend": "Senden fehlgeschlagen",
|
"failedToSend": "Senden fehlgeschlagen",
|
||||||
"couldNotSend": "Workout konnte nicht an Watch gesendet werden. Starte ohne Watch.",
|
"couldNotSend": "Workout konnte nicht an Watch gesendet werden. Starte ohne Watch.",
|
||||||
"startWithoutWatch": "Ohne Watch starten",
|
"watchRequired": "Eine gekoppelte Watch wird benötigt, um ein Workout zu starten",
|
||||||
|
"retry": "Erneut",
|
||||||
"sendToWatchAndStart": "An Watch senden & starten",
|
"sendToWatchAndStart": "An Watch senden & starten",
|
||||||
"syncToWatch": "Workout wird mit deiner Watch synchronisiert",
|
"syncToWatch": "Workout wird mit deiner Watch synchronisiert",
|
||||||
"trackedOnDevice": "Workout wird auf diesem Gerät verfolgt",
|
|
||||||
"rest": "Pause",
|
"rest": "Pause",
|
||||||
"betweenSets": "{{duration}}s Pause zwischen Sets",
|
"betweenSets": "{{duration}}s Pause zwischen Sets",
|
||||||
"swimComplete": "Schwimmen abgeschlossen!",
|
"swimComplete": "Schwimmen abgeschlossen!",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Åbn SwimBuddy-appen på din Watch for at begynde sporing.",
|
"openWatchApp": "Åbn SwimBuddy-appen på din Watch for at begynde sporing.",
|
||||||
"failedToSend": "Sendning mislykkedes",
|
"failedToSend": "Sendning mislykkedes",
|
||||||
"couldNotSend": "Kunne ikke sende træning til Watch. Starter uden Watch.",
|
"couldNotSend": "Kunne ikke sende træning til Watch. Starter uden Watch.",
|
||||||
"startWithoutWatch": "Start uden Watch",
|
"watchRequired": "En parret Watch er påkrævet for at starte en træning",
|
||||||
|
"retry": "Prøv igen",
|
||||||
"sendToWatchAndStart": "Send til Watch & start",
|
"sendToWatchAndStart": "Send til Watch & start",
|
||||||
"syncToWatch": "Træningen synkroniseres med din Watch",
|
"syncToWatch": "Træningen synkroniseres med din Watch",
|
||||||
"trackedOnDevice": "Træningen spores på denne enhed",
|
|
||||||
"rest": "Hvile",
|
"rest": "Hvile",
|
||||||
"betweenSets": "{{duration}}s hvile mellem sæt",
|
"betweenSets": "{{duration}}s hvile mellem sæt",
|
||||||
"swimComplete": "Svømning fuldført!",
|
"swimComplete": "Svømning fuldført!",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Open the SwimBuddy app on your watch to start tracking.",
|
"openWatchApp": "Open the SwimBuddy app on your watch to start tracking.",
|
||||||
"failedToSend": "Failed to send",
|
"failedToSend": "Failed to send",
|
||||||
"couldNotSend": "Could not send workout to Watch. Starting without Watch instead.",
|
"couldNotSend": "Could not send workout to Watch. Starting without Watch instead.",
|
||||||
"startWithoutWatch": "Start Without Watch",
|
"watchRequired": "A paired Watch is required to start a workout",
|
||||||
|
"retry": "Retry",
|
||||||
"sendToWatchAndStart": "Send to Watch & Start",
|
"sendToWatchAndStart": "Send to Watch & Start",
|
||||||
"syncToWatch": "Workout will be synced to your watch",
|
"syncToWatch": "Workout will be synced to your watch",
|
||||||
"trackedOnDevice": "Workout will be tracked on this device",
|
|
||||||
"rest": "Rest",
|
"rest": "Rest",
|
||||||
"betweenSets": "{{duration}}s between sets",
|
"betweenSets": "{{duration}}s between sets",
|
||||||
"swimComplete": "Swim Complete!",
|
"swimComplete": "Swim Complete!",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Abre la app SwimBuddy en tu Watch para empezar el seguimiento.",
|
"openWatchApp": "Abre la app SwimBuddy en tu Watch para empezar el seguimiento.",
|
||||||
"failedToSend": "Error al enviar",
|
"failedToSend": "Error al enviar",
|
||||||
"couldNotSend": "No se pudo enviar el entrenamiento al Watch. Iniciando sin Watch.",
|
"couldNotSend": "No se pudo enviar el entrenamiento al Watch. Iniciando sin Watch.",
|
||||||
"startWithoutWatch": "Iniciar sin Watch",
|
"watchRequired": "Se necesita una Watch emparejada para iniciar un entrenamiento",
|
||||||
|
"retry": "Reintentar",
|
||||||
"sendToWatchAndStart": "Enviar al Watch e iniciar",
|
"sendToWatchAndStart": "Enviar al Watch e iniciar",
|
||||||
"syncToWatch": "El entrenamiento se sincronizará con tu Watch",
|
"syncToWatch": "El entrenamiento se sincronizará con tu Watch",
|
||||||
"trackedOnDevice": "El entrenamiento se rastreará en este dispositivo",
|
|
||||||
"rest": "Descanso",
|
"rest": "Descanso",
|
||||||
"betweenSets": "{{duration}}s de descanso entre series",
|
"betweenSets": "{{duration}}s de descanso entre series",
|
||||||
"swimComplete": "¡Natación completada!",
|
"swimComplete": "¡Natación completada!",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Ouvrez l'application SwimBuddy sur votre Watch pour commencer le suivi.",
|
"openWatchApp": "Ouvrez l'application SwimBuddy sur votre Watch pour commencer le suivi.",
|
||||||
"failedToSend": "Échec de l'envoi",
|
"failedToSend": "Échec de l'envoi",
|
||||||
"couldNotSend": "Impossible d'envoyer l'entraînement à la Watch. Démarrage sans Watch.",
|
"couldNotSend": "Impossible d'envoyer l'entraînement à la Watch. Démarrage sans Watch.",
|
||||||
"startWithoutWatch": "Démarrer sans Watch",
|
"watchRequired": "Une Watch appariée est nécessaire pour commencer un entraînement",
|
||||||
|
"retry": "Réessayez",
|
||||||
"sendToWatchAndStart": "Envoyer à la Watch et commencer",
|
"sendToWatchAndStart": "Envoyer à la Watch et commencer",
|
||||||
"syncToWatch": "L'entraînement sera synchronisé avec votre Watch",
|
"syncToWatch": "L'entraînement sera synchronisé avec votre Watch",
|
||||||
"trackedOnDevice": "L'entraînement sera suivi sur cet appareil",
|
|
||||||
"rest": "Repos",
|
"rest": "Repos",
|
||||||
"betweenSets": "{{duration}}s de repos entre les séries",
|
"betweenSets": "{{duration}}s de repos entre les séries",
|
||||||
"swimComplete": "Nage terminée !",
|
"swimComplete": "Nage terminée !",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Apri l'app SwimBuddy sulla tua Watch per iniziare il monitoraggio.",
|
"openWatchApp": "Apri l'app SwimBuddy sulla tua Watch per iniziare il monitoraggio.",
|
||||||
"failedToSend": "Invio fallito",
|
"failedToSend": "Invio fallito",
|
||||||
"couldNotSend": "Impossibile inviare l'allenamento alla Watch. Avvio senza Watch.",
|
"couldNotSend": "Impossibile inviare l'allenamento alla Watch. Avvio senza Watch.",
|
||||||
"startWithoutWatch": "Avvia senza Watch",
|
"watchRequired": "È necessaria una Watch associata per iniziare un allenamento",
|
||||||
|
"retry": "Riprova",
|
||||||
"sendToWatchAndStart": "Invia alla Watch e avvia",
|
"sendToWatchAndStart": "Invia alla Watch e avvia",
|
||||||
"syncToWatch": "L'allenamento verrà sincronizzato con la tua Watch",
|
"syncToWatch": "L'allenamento verrà sincronizzato con la tua Watch",
|
||||||
"trackedOnDevice": "L'allenamento verrà monitorato su questo dispositivo",
|
|
||||||
"rest": "Recupero",
|
"rest": "Recupero",
|
||||||
"betweenSets": "{{duration}}s di recupero tra le serie",
|
"betweenSets": "{{duration}}s di recupero tra le serie",
|
||||||
"swimComplete": "Nuoto completato!",
|
"swimComplete": "Nuoto completato!",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Open de SwimBuddy-app op je Watch om te beginnen met bijhouden.",
|
"openWatchApp": "Open de SwimBuddy-app op je Watch om te beginnen met bijhouden.",
|
||||||
"failedToSend": "Verzenden mislukt",
|
"failedToSend": "Verzenden mislukt",
|
||||||
"couldNotSend": "Kon workout niet naar Watch verzenden. Start zonder Watch.",
|
"couldNotSend": "Kon workout niet naar Watch verzenden. Start zonder Watch.",
|
||||||
"startWithoutWatch": "Start zonder Watch",
|
"watchRequired": "Een gekoppelde Watch is vereist om een workout te starten",
|
||||||
|
"retry": "Opnieuw",
|
||||||
"sendToWatchAndStart": "Verzenden naar Watch & Start",
|
"sendToWatchAndStart": "Verzenden naar Watch & Start",
|
||||||
"syncToWatch": "Workout wordt gesynchroniseerd naar je Watch",
|
"syncToWatch": "Workout wordt gesynchroniseerd naar je Watch",
|
||||||
"trackedOnDevice": "Workout wordt op dit apparaat bijgehouden",
|
|
||||||
"rest": "Rust",
|
"rest": "Rust",
|
||||||
"betweenSets": "{{duration}}s rust tussen sets",
|
"betweenSets": "{{duration}}s rust tussen sets",
|
||||||
"swimComplete": "Zwemmen voltooid!",
|
"swimComplete": "Zwemmen voltooid!",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Otwórz aplikację SwimBuddy na swojej Watch, aby rozpocząć śledzenie.",
|
"openWatchApp": "Otwórz aplikację SwimBuddy na swojej Watch, aby rozpocząć śledzenie.",
|
||||||
"failedToSend": "Nie udało się wysłać",
|
"failedToSend": "Nie udało się wysłać",
|
||||||
"couldNotSend": "Nie udało się wysłać treningu do Watch. Uruchamianie bez Watch.",
|
"couldNotSend": "Nie udało się wysłać treningu do Watch. Uruchamianie bez Watch.",
|
||||||
"startWithoutWatch": "Uruchom bez Watch",
|
"watchRequired": "Sparowana Watch jest wymagana do rozpoczęcia treningu",
|
||||||
|
"retry": "Ponów",
|
||||||
"sendToWatchAndStart": "Wyślij do Watch i rozpocznij",
|
"sendToWatchAndStart": "Wyślij do Watch i rozpocznij",
|
||||||
"syncToWatch": "Trening zostanie zsynchronizowany z Watch",
|
"syncToWatch": "Trening zostanie zsynchronizowany z Watch",
|
||||||
"trackedOnDevice": "Trening będzie śledzony na tym urządzeniu",
|
|
||||||
"rest": "Odpoczynek",
|
"rest": "Odpoczynek",
|
||||||
"betweenSets": "{{duration}}s odpoczynku między seriami",
|
"betweenSets": "{{duration}}s odpoczynku między seriami",
|
||||||
"swimComplete": "Pływanie zakończone!",
|
"swimComplete": "Pływanie zakończone!",
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
"openWatchApp": "Abra a aplicação SwimBuddy na sua Watch para iniciar o registo.",
|
"openWatchApp": "Abra a aplicação SwimBuddy na sua Watch para iniciar o registo.",
|
||||||
"failedToSend": "Falha no envio",
|
"failedToSend": "Falha no envio",
|
||||||
"couldNotSend": "Não foi possível enviar o treino para a Watch. Iniciando sem Watch.",
|
"couldNotSend": "Não foi possível enviar o treino para a Watch. Iniciando sem Watch.",
|
||||||
"startWithoutWatch": "Iniciar sem Watch",
|
"watchRequired": "É necessária uma Watch associada para iniciar um treino",
|
||||||
|
"retry": "Tentar novamente",
|
||||||
"sendToWatchAndStart": "Enviar para a Watch e iniciar",
|
"sendToWatchAndStart": "Enviar para a Watch e iniciar",
|
||||||
"syncToWatch": "O treino será sincronizado com a sua Watch",
|
"syncToWatch": "O treino será sincronizado com a sua Watch",
|
||||||
"trackedOnDevice": "O treino será registado neste dispositivo",
|
|
||||||
"rest": "Descanso",
|
"rest": "Descanso",
|
||||||
"betweenSets": "{{duration}}s de descanso entre séries",
|
"betweenSets": "{{duration}}s de descanso entre séries",
|
||||||
"swimComplete": "Natação concluída!",
|
"swimComplete": "Natação concluída!",
|
||||||
|
|||||||
Reference in New Issue
Block a user