Skip to content

Commit ef4b96c

Browse files
authored
Merge pull request #2160 from RoboSats/pre-release-fixes-v0.8.1-2
Pre release fixes v0.8.1 2
2 parents 9b9ec82 + fd956dd commit ef4b96c

File tree

6 files changed

+29
-50
lines changed

6 files changed

+29
-50
lines changed

android/app/src/main/java/com/robosats/WebAppInterface.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,6 @@ class WebAppInterface(private val context: MainActivity, private val webView: We
105105

106106
@JavascriptInterface
107107
fun copyToClipboard(message: String) {
108-
// Validate input
109-
if (!isValidInput(message)) {
110-
Log.e(TAG, "Invalid input for copyToClipboard")
111-
Toast.makeText(context, "Invalid content for clipboard", Toast.LENGTH_SHORT).show()
112-
return
113-
}
114-
115108
try {
116109
// Copy to clipboard
117110
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as android.content.ClipboardManager

api/nostr.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import pygeohash
22
import hashlib
33
import uuid
4-
import random
5-
from datetime import datetime, timedelta
64

75
from secp256k1 import PrivateKey
86
from asgiref.sync import sync_to_async
@@ -59,22 +57,6 @@ async def send_notification_event(self, robot, order, text):
5957
]
6058
),
6159
Tag.parse(["status", str(order.status)]),
62-
Tag.parse(
63-
[
64-
"expiration",
65-
str(
66-
int(
67-
(
68-
datetime.now()
69-
+ timedelta(days=14)
70-
+ timedelta(
71-
seconds=random.randint(0, 14 * 24 * 60 * 60)
72-
)
73-
).timestamp()
74-
)
75-
),
76-
]
77-
),
7860
]
7961

8062
await client.send_private_msg(PublicKey.parse(robot.nostr_pubkey), text, tags)

frontend/src/components/Dialogs/AuditPGP.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ const AuditPGPDialog = ({
8888
const [passphrase, setPassphrase] = useState<string>();
8989

9090
useEffect(() => {
91-
const slot = order
92-
? garage.getSlotByOrder(order?.shortAlias ?? '', order?.id ?? 0)
93-
: garage.getSlot();
91+
const slot = garage.getSlot();
9492
setSlot(slot);
9593
setOwnPubKey(slot?.getRobot()?.pubKey ?? '');
9694
setOwnEncPrivKey(slot?.getRobot()?.encPrivKey ?? '');

frontend/src/components/TradeBox/EncryptedChat/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ const EncryptedChat: React.FC<Props> = ({
8686

8787
const wrappedEvent = nip17.wrapEvent(slot?.nostrSecKey, recipient, content);
8888

89-
const fourteenDays = 14 * 24 * 60 * 60;
90-
const randomSeconds = Math.floor(Math.random() * fourteenDays);
91-
const expirationTime = Math.floor(Date.now() / 1000) + fourteenDays + randomSeconds;
92-
93-
wrappedEvent.tags.push(['expiration', expirationTime.toString()]);
94-
9589
federation.roboPool.sendEvent(wrappedEvent);
9690
} catch (error) {
9791
console.error('Nostr nip17 error:', error);

frontend/src/components/TradeBox/Prompts/Chat.tsx

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const ChatPrompt = ({
6060
const [undoSentButton, setUndoSentButton] = useState<boolean>(false);
6161
const [audit, setAudit] = useState<boolean>(false);
6262
const [peerPubKey, setPeerPubKey] = useState<string>();
63+
const [enableCollaborativeButton, setEnableCollaborativeButton] = useState<boolean>(false);
6364
const [enableDisputeButton, setEnableDisputeButton] = useState<boolean>(false);
6465
const [enableDisputeTime, setEnableDisputeTime] = useState<Date>(new Date(order.expires_at));
6566
const [text, setText] = useState<string>('');
@@ -92,6 +93,8 @@ export const ChatPrompt = ({
9293

9394
if (order.status === 9) {
9495
// No fiat sent yet
96+
setEnableCollaborativeButton(true);
97+
9598
if (order.is_buyer) {
9699
setSentButton(true);
97100
setReceivedButton(false);
@@ -117,6 +120,8 @@ export const ChatPrompt = ({
117120
}
118121
} else if (order.status === 10) {
119122
// Fiat has been sent already
123+
setEnableCollaborativeButton(false);
124+
120125
if (order.is_buyer) {
121126
setSentButton(false);
122127
setUndoSentButton(true);
@@ -301,21 +306,28 @@ export const ChatPrompt = ({
301306
</Grid>
302307
</Tooltip>
303308

304-
<Grid item xs={1} style={{ width: '100%', marginTop: 20 }}>
305-
<Button
306-
fullWidth
307-
onClick={() => {
308-
setOpenOrderOptions(false);
309-
onClickCollabCancel();
310-
}}
311-
size='large'
312-
variant='contained'
313-
color='secondary'
314-
startIcon={<Handshake />}
315-
>
316-
{t('Collaborative Cancel')}
317-
</Button>
318-
</Grid>
309+
<Tooltip
310+
placement='top'
311+
enterTouchDelay={0}
312+
title={t("Orders can't be cancelled if fiat has been sent.")}
313+
>
314+
<Grid item xs={1} style={{ width: '100%', marginTop: 20 }}>
315+
<Button
316+
fullWidth
317+
onClick={() => {
318+
setOpenOrderOptions(false);
319+
onClickCollabCancel();
320+
}}
321+
size='large'
322+
variant='contained'
323+
color='secondary'
324+
startIcon={<Handshake />}
325+
disabled={!enableCollaborativeButton}
326+
>
327+
{t('Collaborative Cancel')}
328+
</Button>
329+
</Grid>
330+
</Tooltip>
319331
</Grid>
320332
</DialogContent>
321333
</DialogContent>

frontend/src/models/Settings.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class BaseSettings {
5858
});
5959

6060
systemClient.getItem('settings_notifications').then((result) => {
61-
this.androidNotifications = result === 'true';
61+
this.androidNotifications = !result ? client === 'mobile' : result === 'true';
6262
});
6363

6464
systemClient.getItem('settings_use_proxy').then((result) => {

0 commit comments

Comments
 (0)