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