Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/OfflineUndownloadWarning.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Text } from '@/components/ui/text';
import { useLocalization } from '@/hooks/useLocalization';
import { colors, spacing } from '@/styles/theme';
import { storage } from '@/utils/storage';
Expand All @@ -6,7 +7,6 @@ import {
Modal,
StyleSheet,
Switch,
Text,
TouchableOpacity,
View
} from 'react-native';
Expand Down
30 changes: 18 additions & 12 deletions components/QuestOffloadVerificationDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ interface QuestOffloadVerificationDrawerProps {
onContinue: () => void;
verificationState: VerificationState;
isOffloading: boolean;
questName?: string;
}

interface CategoryRowProps {
Expand Down Expand Up @@ -136,7 +137,8 @@ export function QuestOffloadVerificationDrawer({
onOpenChange,
onContinue,
verificationState,
isOffloading
isOffloading,
questName
}: QuestOffloadVerificationDrawerProps) {
const { t } = useLocalization();
const {
Expand Down Expand Up @@ -222,7 +224,7 @@ export function QuestOffloadVerificationDrawer({
}
);

// Calculate if ready to offload (all records verified, no errors, no pending uploads)
// Calculate if ready to remove (all records verified, no errors, no pending uploads)
const isReadyToOffload =
!isVerifying &&
!hasPendingUploads &&
Expand Down Expand Up @@ -252,17 +254,21 @@ export function QuestOffloadVerificationDrawer({
<DrawerHeader>
<View className="flex-row items-center justify-between">
<View className="flex-1">
<DrawerTitle>{t('offloadQuest') || 'Offload Quest'}</DrawerTitle>
<DrawerTitle>
{t('offloadQuest') || 'Remove Download'}
</DrawerTitle>
<Text className="text-sm text-muted-foreground">
{hasPendingUploads
? t('pendingUploadsDetected') || 'Pending uploads detected'
: isVerifying
? t('verifyingCloudData') || 'Verifying data in cloud...'
: isReadyToOffload
? t('readyToOffload') || 'Ready to offload'
? questName
? `Ready to remove "${questName.trim()}"`
: t('readyToRemove') || 'Ready to remove'
: hasError
? t('cannotOffloadErrors') ||
'Cannot offload - errors detected'
'Cannot remove - errors detected'
: t('checkingPendingChanges') ||
'Checking for pending changes...'}
</Text>
Expand Down Expand Up @@ -293,7 +299,7 @@ export function QuestOffloadVerificationDrawer({
</View>
<Text className="text-sm text-muted-foreground">
{t('pendingUploadsMessage') ||
`You have ${pendingUploadCount} pending upload(s). Please wait for all changes to upload to the cloud before offloading. Connect to the internet and wait for sync to complete.`}
`You have ${pendingUploadCount} pending upload(s). Please wait for all changes to upload to the cloud before removing. Connect to the internet and wait for sync to complete.`}
</Text>
</View>
</View>
Expand Down Expand Up @@ -378,8 +384,8 @@ export function QuestOffloadVerificationDrawer({
{isReadyToOffload && (
<View className="mb-2 rounded-lg bg-yellow-500/10 p-3">
<Text className="text-sm text-yellow-600">
{t('offloadWarning') ||
'This will delete local copies. Data will remain safely in the cloud and can be re-downloaded later.'}
{t('removeQuestWarning') ||
'This will remove the local copy of this quest and all related files from your device. Data will remain safely in the cloud and can be re-downloaded later.'}
</Text>
</View>
)}
Expand All @@ -398,7 +404,7 @@ export function QuestOffloadVerificationDrawer({
</View>
<Text className="text-sm text-destructive">
{t('cannotOffloadErrors') ||
'Some data has not been uploaded to the cloud yet. Check the list above for items marked in red - these need to sync before you can safely offload.'}
'Some data has not been uploaded to the cloud yet. Check the list above for items marked in red - these need to sync before you can safely remove.'}
</Text>
{progress.attachments.count >
progress.attachments.verified && (
Expand All @@ -417,7 +423,7 @@ export function QuestOffloadVerificationDrawer({
⚠️ DEV MODE ONLY
</Text>
<Text className="mb-2 text-xs text-yellow-600">
Force offload will delete local data even if not fully
Force remove will delete local data even if not fully
backed up. Use only for testing!
</Text>
<Button
Expand All @@ -428,7 +434,7 @@ export function QuestOffloadVerificationDrawer({
disabled={hasPendingUploads || isOffloading}
>
<Text className="text-xs font-bold text-yellow-600">
Force Offload (Dev Only)
Force Remove (Dev Only)
</Text>
</Button>
</View>
Expand All @@ -452,7 +458,7 @@ export function QuestOffloadVerificationDrawer({
: hasPendingUploads
? t('waitingForUploads') || 'Waiting for Uploads'
: isReadyToOffload
? t('continueToOffload') || 'Offload from Device'
? t('removeQuestFromDevice') || 'Remove from device'
: t('cannotOffload') || 'Cannot Offload'}
</Text>
</Button>
Expand Down
Loading
Loading