added shared volume to diagnostic, added folder picker to android app, fixed bridge for attachment uploading, fixed hopefully chat history in android app
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
} from 'react-native';
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import RNFS from 'react-native-fs';
|
||||
import DocumentPicker from 'react-native-document-picker';
|
||||
import rvs, { ConnectionState, RVSMessage, ConnectionConfig, ConnectionLogEntry } from '../services/rvs';
|
||||
import ModeSelector from '../components/ModeSelector';
|
||||
import QRScanner from '../components/QRScanner';
|
||||
@@ -115,28 +116,39 @@ const SettingsScreen: React.FC = () => {
|
||||
Alert.alert('Gespeichert', `Neuer Speicherort:\n${clean}\n\nWird ab der naechsten Nachricht verwendet.`);
|
||||
}, []);
|
||||
|
||||
const storagePaths = [
|
||||
{ label: 'App-intern (Standard)', path: DEFAULT_STORAGE_PATH },
|
||||
{ label: 'Externer Speicher', path: '/storage/emulated/0/ARIA/attachments' },
|
||||
{ label: 'SD-Karte', path: '/storage/sdcard1/ARIA/attachments' },
|
||||
{ label: 'Downloads', path: '/storage/emulated/0/Download/ARIA' },
|
||||
];
|
||||
|
||||
const showPathPicker = useCallback(() => {
|
||||
const options = storagePaths.map(p => p.label);
|
||||
options.push('Eigenen Pfad eingeben');
|
||||
options.push('Abbrechen');
|
||||
|
||||
Alert.alert(
|
||||
'Speicherort waehlen',
|
||||
'Wo sollen Anhaenge gespeichert werden?',
|
||||
[
|
||||
...storagePaths.map(p => ({
|
||||
text: p.label,
|
||||
onPress: () => saveStoragePath(p.path),
|
||||
})),
|
||||
{
|
||||
text: 'Eigenen Pfad eingeben',
|
||||
text: 'Ordner auswaehlen...',
|
||||
onPress: async () => {
|
||||
try {
|
||||
const result = await DocumentPicker.pickDirectory();
|
||||
if (result?.uri) {
|
||||
// SAF URI decodieren (content://com.android.externalstorage...)
|
||||
const decoded = decodeURIComponent(result.uri);
|
||||
// Versuche einen lesbaren Pfad zu extrahieren
|
||||
const match = decoded.match(/primary[:%]3A(.+)/);
|
||||
const readablePath = match
|
||||
? `/storage/emulated/0/${match[1].replace(/%2F|%3A/g, '/')}`
|
||||
: decoded;
|
||||
saveStoragePath(readablePath);
|
||||
}
|
||||
} catch (e: any) {
|
||||
if (!DocumentPicker.isCancel(e)) {
|
||||
Alert.alert('Fehler', 'Ordnerauswahl fehlgeschlagen');
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
text: 'App-intern (Standard)',
|
||||
onPress: () => saveStoragePath(DEFAULT_STORAGE_PATH),
|
||||
},
|
||||
{
|
||||
text: 'Pfad manuell eingeben',
|
||||
onPress: () => { setTempPath(storagePath); setEditingPath(true); },
|
||||
},
|
||||
{ text: 'Abbrechen', style: 'cancel' as const },
|
||||
|
||||
Reference in New Issue
Block a user