Merge pull request #2160 from RoboSats/pre-release-fixes-v0.8.1-2

Pre release fixes v0.8.1 2
This commit is contained in:
KoalaSat
2025-08-10 14:28:25 +00:00
committed by GitHub
6 changed files with 29 additions and 50 deletions

View File

@ -105,13 +105,6 @@ class WebAppInterface(private val context: MainActivity, private val webView: We
@JavascriptInterface @JavascriptInterface
fun copyToClipboard(message: String) { fun copyToClipboard(message: String) {
// Validate input
if (!isValidInput(message)) {
Log.e(TAG, "Invalid input for copyToClipboard")
Toast.makeText(context, "Invalid content for clipboard", Toast.LENGTH_SHORT).show()
return
}
try { try {
// Copy to clipboard // Copy to clipboard
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as android.content.ClipboardManager val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as android.content.ClipboardManager

View File

@ -1,8 +1,6 @@
import pygeohash import pygeohash
import hashlib import hashlib
import uuid import uuid
import random
from datetime import datetime, timedelta
from secp256k1 import PrivateKey from secp256k1 import PrivateKey
from asgiref.sync import sync_to_async from asgiref.sync import sync_to_async
@ -59,22 +57,6 @@ class Nostr:
] ]
), ),
Tag.parse(["status", str(order.status)]), Tag.parse(["status", str(order.status)]),
Tag.parse(
[
"expiration",
str(
int(
(
datetime.now()
+ timedelta(days=14)
+ timedelta(
seconds=random.randint(0, 14 * 24 * 60 * 60)
)
).timestamp()
)
),
]
),
] ]
await client.send_private_msg(PublicKey.parse(robot.nostr_pubkey), text, tags) await client.send_private_msg(PublicKey.parse(robot.nostr_pubkey), text, tags)

View File

@ -88,9 +88,7 @@ const AuditPGPDialog = ({
const [passphrase, setPassphrase] = useState<string>(); const [passphrase, setPassphrase] = useState<string>();
useEffect(() => { useEffect(() => {
const slot = order const slot = garage.getSlot();
? garage.getSlotByOrder(order?.shortAlias ?? '', order?.id ?? 0)
: garage.getSlot();
setSlot(slot); setSlot(slot);
setOwnPubKey(slot?.getRobot()?.pubKey ?? ''); setOwnPubKey(slot?.getRobot()?.pubKey ?? '');
setOwnEncPrivKey(slot?.getRobot()?.encPrivKey ?? ''); setOwnEncPrivKey(slot?.getRobot()?.encPrivKey ?? '');

View File

@ -86,12 +86,6 @@ const EncryptedChat: React.FC<Props> = ({
const wrappedEvent = nip17.wrapEvent(slot?.nostrSecKey, recipient, content); const wrappedEvent = nip17.wrapEvent(slot?.nostrSecKey, recipient, content);
const fourteenDays = 14 * 24 * 60 * 60;
const randomSeconds = Math.floor(Math.random() * fourteenDays);
const expirationTime = Math.floor(Date.now() / 1000) + fourteenDays + randomSeconds;
wrappedEvent.tags.push(['expiration', expirationTime.toString()]);
federation.roboPool.sendEvent(wrappedEvent); federation.roboPool.sendEvent(wrappedEvent);
} catch (error) { } catch (error) {
console.error('Nostr nip17 error:', error); console.error('Nostr nip17 error:', error);

View File

@ -60,6 +60,7 @@ export const ChatPrompt = ({
const [undoSentButton, setUndoSentButton] = useState<boolean>(false); const [undoSentButton, setUndoSentButton] = useState<boolean>(false);
const [audit, setAudit] = useState<boolean>(false); const [audit, setAudit] = useState<boolean>(false);
const [peerPubKey, setPeerPubKey] = useState<string>(); const [peerPubKey, setPeerPubKey] = useState<string>();
const [enableCollaborativeButton, setEnableCollaborativeButton] = useState<boolean>(false);
const [enableDisputeButton, setEnableDisputeButton] = useState<boolean>(false); const [enableDisputeButton, setEnableDisputeButton] = useState<boolean>(false);
const [enableDisputeTime, setEnableDisputeTime] = useState<Date>(new Date(order.expires_at)); const [enableDisputeTime, setEnableDisputeTime] = useState<Date>(new Date(order.expires_at));
const [text, setText] = useState<string>(''); const [text, setText] = useState<string>('');
@ -92,6 +93,8 @@ export const ChatPrompt = ({
if (order.status === 9) { if (order.status === 9) {
// No fiat sent yet // No fiat sent yet
setEnableCollaborativeButton(true);
if (order.is_buyer) { if (order.is_buyer) {
setSentButton(true); setSentButton(true);
setReceivedButton(false); setReceivedButton(false);
@ -117,6 +120,8 @@ export const ChatPrompt = ({
} }
} else if (order.status === 10) { } else if (order.status === 10) {
// Fiat has been sent already // Fiat has been sent already
setEnableCollaborativeButton(false);
if (order.is_buyer) { if (order.is_buyer) {
setSentButton(false); setSentButton(false);
setUndoSentButton(true); setUndoSentButton(true);
@ -301,21 +306,28 @@ export const ChatPrompt = ({
</Grid> </Grid>
</Tooltip> </Tooltip>
<Grid item xs={1} style={{ width: '100%', marginTop: 20 }}> <Tooltip
<Button placement='top'
fullWidth enterTouchDelay={0}
onClick={() => { title={t("Orders can't be cancelled if fiat has been sent.")}
setOpenOrderOptions(false); >
onClickCollabCancel(); <Grid item xs={1} style={{ width: '100%', marginTop: 20 }}>
}} <Button
size='large' fullWidth
variant='contained' onClick={() => {
color='secondary' setOpenOrderOptions(false);
startIcon={<Handshake />} onClickCollabCancel();
> }}
{t('Collaborative Cancel')} size='large'
</Button> variant='contained'
</Grid> color='secondary'
startIcon={<Handshake />}
disabled={!enableCollaborativeButton}
>
{t('Collaborative Cancel')}
</Button>
</Grid>
</Tooltip>
</Grid> </Grid>
</DialogContent> </DialogContent>
</DialogContent> </DialogContent>

View File

@ -58,7 +58,7 @@ class BaseSettings {
}); });
systemClient.getItem('settings_notifications').then((result) => { systemClient.getItem('settings_notifications').then((result) => {
this.androidNotifications = result === 'true'; this.androidNotifications = !result ? client === 'mobile' : result === 'true';
}); });
systemClient.getItem('settings_use_proxy').then((result) => { systemClient.getItem('settings_use_proxy').then((result) => {