mirror of
https://github.com/KoalaSat/nostros.git
synced 2024-09-29 06:30:47 +00:00
Fixes (#353)
This commit is contained in:
commit
9cc485f16d
@ -458,26 +458,16 @@ public class Event {
|
|||||||
values.put("valid_nip05", validateNip05(nip05) ? 1 : 0);
|
values.put("valid_nip05", validateNip05(nip05) ? 1 : 0);
|
||||||
values.put("zap_pubkey", getZapPubkey(lnurl, ln_address));
|
values.put("zap_pubkey", getZapPubkey(lnurl, ln_address));
|
||||||
values.put("id", pubkey);
|
values.put("id", pubkey);
|
||||||
values.put("valid_nip05", validateNip05(nip05) ? 1 : 0);
|
|
||||||
values.put("blocked", 0);
|
values.put("blocked", 0);
|
||||||
database.insert("nostros_users", null, values);
|
database.insert("nostros_users", null, values);
|
||||||
} else if (cursor.moveToFirst()){
|
} else if (cursor.moveToFirst() && created_at > cursor.getInt(0)){
|
||||||
String whereClause = "id = ?";
|
String whereClause = "id = ?";
|
||||||
String[] whereArgs = new String[]{
|
String[] whereArgs = new String[]{
|
||||||
this.pubkey
|
this.pubkey
|
||||||
};
|
};
|
||||||
if (created_at >= cursor.getInt(0) ||
|
values.put("zap_pubkey", getZapPubkey(lnurl, ln_address));
|
||||||
cursor.isNull(1) ||
|
values.put("valid_nip05", validateNip05(nip05) ? 1 : 0);
|
||||||
cursor.getInt(1) == 0) {
|
database.update("nostros_users", values, whereClause, whereArgs);
|
||||||
values.put("valid_nip05", validateNip05(nip05) ? 1 : 0);
|
|
||||||
database.update("nostros_users", values, whereClause, whereArgs);
|
|
||||||
}
|
|
||||||
if (created_at >= cursor.getInt(0) ||
|
|
||||||
cursor.isNull(3) ||
|
|
||||||
cursor.getString(3).equals("")) {
|
|
||||||
values.put("zap_pubkey", getZapPubkey(lnurl, ln_address));
|
|
||||||
database.update("nostros_users", values, whereClause, whereArgs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,15 +245,17 @@ export const LnPayment: React.FC<LnPaymentProps> = ({ open, setOpen, note, user
|
|||||||
>
|
>
|
||||||
{t('lnPayment.anonTip')}
|
{t('lnPayment.anonTip')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
{zapPubkey && (
|
||||||
style={styles.spacer}
|
<Button
|
||||||
mode='contained'
|
style={styles.spacer}
|
||||||
disabled={loading || monto === ''}
|
mode='contained'
|
||||||
onPress={() => generateInvoice(true)}
|
disabled={loading || monto === ''}
|
||||||
loading={loading && isZap}
|
onPress={() => generateInvoice(true)}
|
||||||
>
|
loading={loading && isZap}
|
||||||
{t('lnPayment.zap')}
|
>
|
||||||
</Button>
|
{t('lnPayment.zap')}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
<Button mode='outlined' onPress={() => setOpen(false)}>
|
<Button mode='outlined' onPress={() => setOpen(false)}>
|
||||||
{t('lnPayment.cancel')}
|
{t('lnPayment.cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -421,17 +421,20 @@ export const NoteCard: React.FC<NoteCardProps> = ({
|
|||||||
{showActionCount && reactionsCount()}
|
{showActionCount && reactionsCount()}
|
||||||
</Button>
|
</Button>
|
||||||
</Surface>
|
</Surface>
|
||||||
{(note?.lnurl || note?.ln_address) && (
|
<Button
|
||||||
<Button
|
style={styles.action}
|
||||||
style={styles.action}
|
disabled={!note?.lnurl && !note?.ln_address}
|
||||||
icon={() => (
|
icon={() => (
|
||||||
<MaterialCommunityIcons name='lightning-bolt' size={24} color={'#F5D112'} />
|
<MaterialCommunityIcons
|
||||||
)}
|
name='lightning-bolt'
|
||||||
onPress={() => setOpenLn(true)}
|
size={24}
|
||||||
>
|
color={!note?.lnurl && !note?.ln_address ? undefined : '#F5D112'}
|
||||||
{note.zap_pubkey?.length > 0 ? formatBigNumber(zapsAmount) : ''}
|
/>
|
||||||
</Button>
|
)}
|
||||||
)}
|
onPress={() => setOpenLn(true)}
|
||||||
|
>
|
||||||
|
{note.zap_pubkey?.length > 0 ? formatBigNumber(zapsAmount) : ''}
|
||||||
|
</Button>
|
||||||
{openLn && <LnPayment open={openLn} setOpen={setOpenLn} note={note} />}
|
{openLn && <LnPayment open={openLn} setOpen={setOpenLn} note={note} />}
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
)}
|
)}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useContext, useEffect, useState } from 'react'
|
import React, { useContext, useEffect, useState } from 'react'
|
||||||
import { ScrollView, StyleSheet, View } from 'react-native'
|
import { Dimensions, ScrollView, StyleSheet, View } from 'react-native'
|
||||||
import { AppContext } from '../../Contexts/AppContext'
|
import { AppContext } from '../../Contexts/AppContext'
|
||||||
import { Event } from '../../lib/nostr/Events'
|
import { Event } from '../../lib/nostr/Events'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -147,7 +147,7 @@ export const SendPage: React.FC<SendPageProps> = ({ route }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View style={[styles.textInputContainer, { paddingBottom: note ? 230 : 10 }]}>
|
<View style={[styles.textInputContainer]}>
|
||||||
{note && (
|
{note && (
|
||||||
<View style={styles.noteCard}>
|
<View style={styles.noteCard}>
|
||||||
<NoteCard
|
<NoteCard
|
||||||
@ -165,7 +165,9 @@ export const SendPage: React.FC<SendPageProps> = ({ route }) => {
|
|||||||
ref={(ref) => ref?.focus()}
|
ref={(ref) => ref?.focus()}
|
||||||
mode='outlined'
|
mode='outlined'
|
||||||
multiline
|
multiline
|
||||||
numberOfLines={30}
|
numberOfLines={
|
||||||
|
note ? Dimensions.get('window').height / 35 : Dimensions.get('window').height / 25
|
||||||
|
}
|
||||||
outlineStyle={{ borderColor: 'transparent' }}
|
outlineStyle={{ borderColor: 'transparent' }}
|
||||||
value={content}
|
value={content}
|
||||||
onChangeText={onChangeText}
|
onChangeText={onChangeText}
|
||||||
@ -255,7 +257,8 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
contactsList: {
|
contactsList: {
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
height: 200,
|
maxHeight: 180,
|
||||||
|
paddingBottom: 16,
|
||||||
},
|
},
|
||||||
contactRow: {
|
contactRow: {
|
||||||
paddingLeft: 16,
|
paddingLeft: 16,
|
||||||
|
Loading…
Reference in New Issue
Block a user