Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3cf6308b79 | |||
| 7e5a4da659 | |||
| d27fcaf342 |
@@ -79,8 +79,8 @@ android {
|
||||
applicationId "com.ariacockpit"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 10307
|
||||
versionName "0.1.3.7"
|
||||
versionCode 10309
|
||||
versionName "0.1.3.9"
|
||||
// Fallback fuer Libraries mit Product Flavors
|
||||
missingDimensionStrategy 'react-native-camera', 'general'
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aria-cockpit",
|
||||
"version": "0.1.3.7",
|
||||
"version": "0.1.3.9",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"android": "react-native run-android",
|
||||
|
||||
@@ -169,6 +169,12 @@ export const MemoryBrowser: React.FC<Props> = ({ restrictToIds, title, flatStyle
|
||||
data={filtered}
|
||||
keyExtractor={m => m.id}
|
||||
renderItem={renderItem}
|
||||
// nestedScrollEnabled: notwendig damit die FlatList auf Android
|
||||
// scrollt wenn sie in einer aeusseren ScrollView haengt (Settings-
|
||||
// Screen ist ScrollView). Ohne das frisst der aeussere ScrollView
|
||||
// alle Gesten und die innere Liste ist tot.
|
||||
nestedScrollEnabled={true}
|
||||
keyboardShouldPersistTaps="handled"
|
||||
ListEmptyComponent={
|
||||
<Text style={{color:'#555570',textAlign:'center',padding:20,fontStyle:'italic'}}>
|
||||
{items.length === 0 ? '(keine Memories in der DB)' : '(keine Treffer für diese Filter)'}
|
||||
|
||||
@@ -1375,17 +1375,30 @@ const ChatScreen: React.FC = () => {
|
||||
<TouchableOpacity
|
||||
key={`${item.id}-att-${idx}`}
|
||||
style={styles.memoryAttachmentRow}
|
||||
onPress={() => {
|
||||
onPress={async () => {
|
||||
if (!a.path) return;
|
||||
if (a.localUri) {
|
||||
const localPath = a.localUri.replace(/^file:\/\//, '');
|
||||
const exists = await RNFS.exists(localPath).catch(() => false);
|
||||
if (exists) {
|
||||
if (isImage) setFullscreenImage(a.localUri);
|
||||
else openFileWithIntent(a.localUri.replace(/^file:\/\//, ''), a.mime || '');
|
||||
} else {
|
||||
else openFileWithIntent(localPath, a.mime || '');
|
||||
return;
|
||||
}
|
||||
// Cache weg → localUri leeren + neu laden
|
||||
setMessages(prev => prev.map(mm => mm.id === item.id && mm.memorySaved
|
||||
? { ...mm, memorySaved: { ...mm.memorySaved,
|
||||
attachments: mm.memorySaved.attachments?.map(x =>
|
||||
x.path === a.path ? { ...x, localUri: undefined } : x) } }
|
||||
: mm));
|
||||
if (Platform.OS === 'android') {
|
||||
ToastAndroid.show('Cache leer — lade nach...', ToastAndroid.SHORT);
|
||||
}
|
||||
}
|
||||
// Datei via Bridge nachladen — file_response hat den
|
||||
// memorySaved-Match-Path und cached + zeigt direkt
|
||||
autoOpenPaths.current.add(a.path);
|
||||
rvs.send('file_request' as any, { serverPath: a.path, requestId: `memAtt_${item.id}_${idx}` });
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Text style={styles.memoryAttachmentIcon}>{icon}</Text>
|
||||
@@ -1489,17 +1502,32 @@ const ChatScreen: React.FC = () => {
|
||||
) : (
|
||||
<TouchableOpacity
|
||||
style={styles.attachmentFile}
|
||||
onPress={() => {
|
||||
// Lokal vorhanden \u2192 direkt mit System-Intent oeffnen
|
||||
onPress={async () => {
|
||||
// Lokal vorhanden? Cache koennte geleert worden sein \u2014
|
||||
// Datei-Existenz pruefen bevor wir den Intent feuern.
|
||||
if (att.uri) {
|
||||
openFileWithIntent(att.uri.replace(/^file:\/\//, ''), att.mimeType || '');
|
||||
const localPath = att.uri.replace(/^file:\/\//, '');
|
||||
const exists = await RNFS.exists(localPath).catch(() => false);
|
||||
if (exists) {
|
||||
openFileWithIntent(localPath, att.mimeType || '');
|
||||
return;
|
||||
}
|
||||
// Sonst: file_request \u2192 bei file_response wird die Datei
|
||||
// gespeichert UND geoeffnet (autoOpenPaths-Tracking).
|
||||
// Cache weg \u2192 uri im State leeren damit UI "tippen zum Laden" zeigt
|
||||
setMessages(prev => prev.map(m => m.id === item.id
|
||||
? { ...m, attachments: m.attachments?.map(a =>
|
||||
a.serverPath === att.serverPath ? { ...a, uri: undefined } : a) }
|
||||
: m));
|
||||
if (Platform.OS === 'android') {
|
||||
ToastAndroid.show('Cache leer \u2014 lade nach...', ToastAndroid.SHORT);
|
||||
}
|
||||
}
|
||||
// Re-Download via file_request \u2192 bei file_response wird die
|
||||
// Datei gespeichert UND geoeffnet (autoOpenPaths-Tracking).
|
||||
if (att.serverPath) {
|
||||
autoOpenPaths.current.add(att.serverPath);
|
||||
rvs.send('file_request' as any, { serverPath: att.serverPath, requestId: item.id });
|
||||
} else if (Platform.OS === 'android') {
|
||||
ToastAndroid.show('Datei kann nicht nachgeladen werden (kein serverPath)', ToastAndroid.LONG);
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -868,7 +868,7 @@ const SettingsScreen: React.FC = () => {
|
||||
})()}
|
||||
</View>
|
||||
</Modal>
|
||||
<ScrollView style={styles.container} contentContainerStyle={styles.content}>
|
||||
<ScrollView style={styles.container} contentContainerStyle={styles.content} nestedScrollEnabled={true}>
|
||||
|
||||
{currentSection === null && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user