fixed auto download
This commit is contained in:
@@ -69,6 +69,7 @@ const SettingsScreen: React.FC = () => {
|
||||
const [events, setEvents] = useState<EventEntry[]>([]);
|
||||
const [connLog, setConnLog] = useState<ConnectionLogEntry[]>(rvs.getConnectionLog());
|
||||
const [storagePath, setStoragePath] = useState(DEFAULT_STORAGE_PATH);
|
||||
const [autoDownload, setAutoDownload] = useState(true);
|
||||
const [storageSize, setStorageSize] = useState('...');
|
||||
const [editingPath, setEditingPath] = useState(false);
|
||||
const [tempPath, setTempPath] = useState('');
|
||||
@@ -83,10 +84,13 @@ const SettingsScreen: React.FC = () => {
|
||||
setManualPort(String(config.port));
|
||||
setManualToken(config.token);
|
||||
}
|
||||
// Speicherpfad laden
|
||||
// Speicherpfad + Auto-Download laden
|
||||
AsyncStorage.getItem(STORAGE_PATH_KEY).then(saved => {
|
||||
if (saved) setStoragePath(saved);
|
||||
});
|
||||
AsyncStorage.getItem('aria_auto_download').then(saved => {
|
||||
if (saved !== null) setAutoDownload(saved === 'true');
|
||||
});
|
||||
}, []);
|
||||
|
||||
// Speichergroesse berechnen
|
||||
@@ -441,10 +445,29 @@ const SettingsScreen: React.FC = () => {
|
||||
{/* === Speicher === */}
|
||||
<Text style={styles.sectionTitle}>Anhang-Speicher</Text>
|
||||
<View style={styles.card}>
|
||||
<View style={styles.toggleRow}>
|
||||
<View style={styles.toggleInfo}>
|
||||
<Text style={styles.toggleLabel}>Auto-Download</Text>
|
||||
<Text style={styles.toggleHint}>
|
||||
Fehlende Anhaenge beim App-Start automatisch vom Server laden
|
||||
</Text>
|
||||
</View>
|
||||
<Switch
|
||||
value={autoDownload}
|
||||
onValueChange={(val) => {
|
||||
setAutoDownload(val);
|
||||
AsyncStorage.setItem('aria_auto_download', String(val));
|
||||
}}
|
||||
trackColor={{ false: '#2A2A3E', true: '#0096FF' }}
|
||||
thumbColor={autoDownload ? '#FFFFFF' : '#666680'}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View style={{height: 16}} />
|
||||
<Text style={styles.toggleLabel}>Lokaler Speicherort</Text>
|
||||
<Text style={styles.toggleHint}>
|
||||
Hier werden Bilder und Dateien aus dem Chat gespeichert.
|
||||
Bei geloeschtem Cache werden Anhaenge automatisch ueber RVS neu geladen.
|
||||
{autoDownload ? ' Fehlende Dateien werden automatisch nachgeladen.' : ' Fehlende Dateien koennen per Tippen geladen werden.'}
|
||||
</Text>
|
||||
|
||||
{editingPath ? (
|
||||
|
||||
Reference in New Issue
Block a user