Remove delete on upload for android.

This commit is contained in:
Patrick Fic
2025-11-19 11:39:32 -08:00
parent 5235519dd8
commit f8869b4f0e
10 changed files with 131 additions and 52 deletions

View File

@@ -1,3 +1,4 @@
import { useTheme } from "@/hooks";
import { selectDeleteAfterUpload } from "@/redux/app/app.selectors";
import { signOutStart } from "@/redux/user/user.actions";
import { selectBodyshop, selectCurrentUser } from "@/redux/user/user.selectors";
@@ -10,7 +11,7 @@ import * as Notifications from "expo-notifications";
import * as Updates from "expo-updates";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Alert, ScrollView, StyleSheet, View } from "react-native";
import { Alert, Platform, ScrollView, StyleSheet, View } from "react-native";
import { Button, Card, Divider, List, Text } from "react-native-paper";
import { SafeAreaView } from "react-native-safe-area-context";
import { connect } from "react-redux";
@@ -31,7 +32,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(Tab);
function Tab({ bodyshop, currentUser, signOutStart }) {
const { t } = useTranslation();
const [permissionState, setPermissionState] = useState(null);
const theme = useTheme();
useEffect(() => {
(async () => {
const status = await Notifications.getPermissionsAsync();
@@ -81,6 +82,18 @@ function Tab({ bodyshop, currentUser, signOutStart }) {
</Text>
<UploadDeleteSwitch />
</View>
{Platform.OS === "android" && (
<Card
style={{
marginVertical: 8,
backgroundColor: theme?.colors?.errorContainer,
}}
>
<Text style={{ margin: 8, fontStyle: "italic" }}>
{t("mediabrowser.labels.android_deletephotos_message")}
</Text>
</Card>
)}
<List.Item
title="Media Storage"
description={

View File

@@ -1,4 +1,5 @@
import React from "react";
import { Platform } from "react-native";
import { Switch } from "react-native-paper";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -22,7 +23,8 @@ export function UploadDeleteSwitch({
onValueChange={() => {
toggleDeleteAfterUpload();
}}
value={deleteAfterUpload}
value={Platform.OS === "android" ? false : deleteAfterUpload}
disabled={Platform.OS === "android"}
/>
);
}