diff --git a/ts/components/leftpane/overlay/OverlayMessage.tsx b/ts/components/leftpane/overlay/OverlayMessage.tsx
index ae9121fc..ddcb76c4 100644
--- a/ts/components/leftpane/overlay/OverlayMessage.tsx
+++ b/ts/components/leftpane/overlay/OverlayMessage.tsx
@@ -27,7 +27,7 @@ import { CopyIconButton } from '../../icon/CopyIconButton';
import { BchatIconButton } from '../../icon';
import { QRView } from '../../dialog/EditProfileDialog';
import { Flex } from '../../basic/Flex';
-import { getLeftPaneLists } from '../../../state/selectors/conversations';
+// import { getLeftPaneLists } from '../../../state/selectors/conversations';
import classNames from 'classnames';
export const OverlayMessage = () => {
@@ -43,10 +43,10 @@ export const OverlayMessage = () => {
const [dispalyQR, setDispalyQR] = useState(false);
const ourNumber = useSelector(getOurNumber);
const ourconvo = getConversationController().get(ourNumber);
- const convoList = useSelector(getLeftPaneLists);
+ // const convoList = useSelector(getLeftPaneLists);
const walletAddress:any = localStorage.getItem('userAddress');
- const convolen: boolean =convoList?.contacts?.length === 0 || false;
- console.log('convolen',convolen)
+ // const convolen: boolean =convoList?.contacts?.length === 0 || false;
+
// const title = window.i18n('newBchat');
// const buttonText = window.i18n('next');
diff --git a/ts/components/menu/Menu.tsx b/ts/components/menu/Menu.tsx
index ad52d762..ba7f5a99 100644
--- a/ts/components/menu/Menu.tsx
+++ b/ts/components/menu/Menu.tsx
@@ -162,13 +162,8 @@ export const MenuWrapper = styled.span`
/** Menu items standardized */
export const InviteContactMenuItem = (): JSX.Element | null => {
- console.log("InviteContactMenuItem::")
const convoId = useContext(ContextConversationId);
const isPublic = useIsPublic(convoId);
- console.log("convoId:", convoId)
- // console.log("isPublic:", isPublic)
- // console.log("showInviteContact(isPublic):", showInviteContact(isPublic))
- // console.log("showInviteContactByConvoId(convoId):", showInviteContactByConvoId(convoId));
if (showInviteContact(isPublic)) {
return (
@@ -177,9 +172,8 @@ export const InviteContactMenuItem = (): JSX.Element | null => {
showInviteContactByConvoId(convoId);
}}
>
-
+
{window.i18n('inviteContacts')}
-
);
}
@@ -302,12 +296,21 @@ export const LeaveGroupMenuItem = () => {
return (
- {
- showLeaveGroupByConvoId(convoId, username,
);
+ showLeaveGroupByConvoId(
+ convoId,
+ username,
+
+ );
}}
>
-
+
{window.i18n('leaveGroup')}
-
);
}
@@ -458,7 +461,6 @@ export const DisappearingMessageMenuItem = (): JSX.Element | null => {
const timerOptions = useSelector(getTimerOptions).timerOptions;
const isRequest = useIsRequest(convoId);
const ourNumber = useSelector(getOurNumber);
- console.log("timerOptions:",timerOptions)
if (ourNumber === convoId) {
return null;
}
@@ -482,11 +484,11 @@ export const DisappearingMessageMenuItem = (): JSX.Element | null => {
>
}
arrow={
}
-
>
{timerOptions.map(item => (
-
- -
+
- {
await setDisappearingMessagesByConvoId(convoId, item.value);
@@ -495,7 +497,6 @@ export const DisappearingMessageMenuItem = (): JSX.Element | null => {
{item.name}
-
))}
);
@@ -514,7 +515,13 @@ export const NotificationForConvoMenuItem = (): JSX.Element | null => {
const isMe = useIsMe(convoId);
if (
- showNotificationConvo(Boolean(isKickedFromGroup), Boolean(left), Boolean(isBlocked), isRequest, isMe)
+ showNotificationConvo(
+ Boolean(isKickedFromGroup),
+ Boolean(left),
+ Boolean(isBlocked),
+ isRequest,
+ isMe
+ )
) {
// exclude mentions_only settings for private chats as this does not make much sense
const notificationForConvoOptions = ConversationNotificationSetting.filter(n =>
@@ -525,8 +532,8 @@ export const NotificationForConvoMenuItem = (): JSX.Element | null => {
n === 'all' || !n
? 'notificationForConvo_all'
: n === 'disabled'
- ? 'notificationForConvo_disabled'
- : 'notificationForConvo_mentions_only';
+ ? 'notificationForConvo_disabled'
+ : 'notificationForConvo_mentions_only';
return { value: n, name: window.i18n(keyToUse) };
});
@@ -545,25 +552,28 @@ export const NotificationForConvoMenuItem = (): JSX.Element | null => {
>
}
arrow={
}
- // label={window.i18n('notificationForConvo') as any}
+ // label={window.i18n('notificationForConvo') as any}
>
{(notificationForConvoOptions || []).map(item => {
const disabled = item.value === currentNotificationSetting;
return (
-
-
-
+
- {
await setNotificationForConvoId(convoId, item.value);
}}
// disabled={disabled}
>
-
-
+
+
{item.name}
@@ -689,7 +699,14 @@ export const AcceptMenuItem = () => {
await approveConvoAndSendResponse(convoId, true);
}}
>
- {window.i18n('accept')}
+
+
{window.i18n('accept')}
);
}
@@ -699,7 +716,7 @@ export const AcceptMenuItem = () => {
export const DeclineMenuItem = () => {
const convoId = useContext(ContextConversationId);
const isRequest = useIsRequest(convoId);
- const customIcon =
+ const customIcon =
;
if (isRequest) {
return (
@@ -708,7 +725,14 @@ export const DeclineMenuItem = () => {
declineConversationWithConfirm(convoId, true, customIcon);
}}
>
- {window.i18n('decline')}
+
+
{window.i18n('decline')}
);
}
diff --git a/ts/components/registration/RegistrationStages.tsx b/ts/components/registration/RegistrationStages.tsx
index 3f54b5a7..09222351 100644
--- a/ts/components/registration/RegistrationStages.tsx
+++ b/ts/components/registration/RegistrationStages.tsx
@@ -13,6 +13,7 @@ import { wallet } from '../../wallet/wallet-rpc';
import { AccentText } from './AccentText';
import { TermsAndConditions } from './TermsAndConditions';
import { Flex } from '../basic/Flex';
+import { SpacerLG } from '../basic/Text';
export const MAX_USERNAME_LENGTH = 26;
// tslint:disable: use-simple-attributes
@@ -217,11 +218,9 @@ export const RegistrationStages = () => {
}, []);
const generateMnemonicAndKeyPairaa = async () => {
- // console.log('registration');
await wallet.startWallet();
};
const imageValidator = (e: any) => {
- console.log('imageValidator');
setImageCount(e);
};
const displayImg = () => {
@@ -247,7 +246,7 @@ export const RegistrationStages = () => {
flexDirection="row"
container={true}
height="100%"
- width="40%"
+ width="45%"
justifyContent="flex-end"
>
@@ -259,7 +258,7 @@ export const RegistrationStages = () => {
flexDirection="column"
container={true}
height="100%"
- width="60%"
+ width="55%"
justifyContent="center"
>
@@ -288,6 +287,8 @@ export const RegistrationStages = () => {
imageValidator={(e: Number) => imageValidator(e)}
/>
)}
+
+ {/* */}
{accent && }
diff --git a/ts/components/registration/SignInTab.tsx b/ts/components/registration/SignInTab.tsx
index 162afcd4..6640b91a 100644
--- a/ts/components/registration/SignInTab.tsx
+++ b/ts/components/registration/SignInTab.tsx
@@ -21,6 +21,7 @@ import { mn_decode } from '../../bchat/crypto/mnemonic';
import { ToastUtils } from '../../bchat/utils';
import { WalletPassword } from './WalletPass';
import { Flex } from '../basic/Flex';
+import moment from 'moment';
// import { BchatIconButton } from '../icon/BchatIconButton';
const { clipboard } = require('electron');
@@ -46,13 +47,15 @@ export enum SignInMode {
const RestoreUsingRecoveryPhraseButton = (props: { onRecoveryButtonClicked: () => any }) => {
return (
-
+
+
+
);
};
@@ -107,7 +110,7 @@ const SignInButtons = (props: {
export const SignInTab = (props: any) => {
const { setRegistrationPhase, signInMode, setSignInMode } = useContext(RegistrationContext);
-
+ const today = moment().format('YYYY-MM-DD');
const [password, setPassword] = useState('');
const [repassword, setRepassword] = useState('');
@@ -135,8 +138,12 @@ export const SignInTab = (props: any) => {
// Seed is mandatory no matter which mode
// const seedOK = (blockheight && !recoveryPhraseError) || (restoreDate && !recoveryPhraseError);
+ const year = moment(restoreDate).year();
- const activateContinueButton = displayNameOK && !loading && (blockheight || restoreDate);
+ const activateContinueButton =
+ displayNameOK &&
+ !loading &&
+ (blockheight || (Number(year) > 2019 && !moment(restoreDate).isAfter(today)));
localStorage.setItem('walletUserName', displayName);
const continueYourBchat = async () => {
@@ -247,14 +254,18 @@ export const SignInTab = (props: any) => {
>
);
}
+ const handleInputChange = (setter: React.Dispatch
>, e: string) => {
+ const newValue = e.replace(/\s+/g, '');
+ setter(newValue);
+ };
if (screenName === 2) {
return (
setPassword(e)}
- setRepassword={(e: any) => setRepassword(e)}
+ setPassword={(e: string) => handleInputChange(setPassword, e)}
+ setRepassword={(e: string) => handleInputChange(setRepassword, e)}
backArrow={() => {
setScreenName(1);
props.imageValidator(LeftImage.recoveryseed);
@@ -282,10 +293,10 @@ export const SignInTab = (props: any) => {
@@ -318,17 +329,21 @@ export const SignInTab = (props: any) => {
{window.i18n('restoreFromSeed')}
*/}
- {
- props.assent(true);
- setScreenName(1);
- setPassword('');
- setRepassword('');
- setBlockheight('');
- setRestoreDate('');
- props.imageValidator(LeftImage.registration);
- }} />
+ {
+ props.assent(true);
+ setScreenName(1);
+ setPassword('');
+ setRepassword('');
+ setBlockheight('');
+ setRestoreDate('');
+ props.imageValidator(LeftImage.registration);
+ }}
+ />
- {window.i18n('restoreFromSeed')}
+
+ {window.i18n('restoreFromSeed')}
+
{
onValueChanged={(name: string) => {
const sanitizedName = sanitizeBchatUsername(name);
const trimName = sanitizedName.trim();
- setDisplayName(sanitizedName.replace(/\s/g, ''));
+ // const alphanumericName = sanitizedName.replace(/[^a-zA-Z0-9]/g, '');
+ setDisplayName(sanitizedName);
setDisplayNameError(!trimName ? window.i18n('displayNameEmpty') : undefined);
}}
// onEnterPressed={props.handlePressEnter}
@@ -376,6 +392,7 @@ export const SignInTab = (props: any) => {
{
setDisplayName('');
setIsLoading(false);
props.assent(false);
- props.imageValidator(LeftImage.recoveryseed)
+ props.imageValidator(LeftImage.recoveryseed);
}}
onLinkDeviceButtonClicked={() => {
setRegistrationPhase(RegistrationPhase.SignIn);
diff --git a/ts/components/registration/SignUpTab.tsx b/ts/components/registration/SignUpTab.tsx
index c6e2693f..1f8972e8 100644
--- a/ts/components/registration/SignUpTab.tsx
+++ b/ts/components/registration/SignUpTab.tsx
@@ -22,13 +22,17 @@ export enum SignUpMode {
}
const CreateBchatIdButton = ({ createBchatID }: { createBchatID: any }) => {
+
return (
+
+
);
};
@@ -47,7 +51,7 @@ export const GoBackMainMenuButton = (props: any) => {
iconSize="huge"
iconType="KeyboardBackspaceArrow"
// iconPadding="5px"
- iconColor='#A9AEBA'
+ iconColor="#A9AEBA"
onClick={() => {
setRegistrationPhase(RegistrationPhase.Start);
setSignInMode(SignInMode.Default);
@@ -131,10 +135,10 @@ export const SignUpTab = (props: any) => {
@@ -184,16 +188,22 @@ export const SignUpTab = (props: any) => {
if (displayNameScreen === 1) {
setPassword('');
setRepassword('');
- props.imageValidator(LeftImage.registration)
+ props.imageValidator(LeftImage.registration);
}
};
+
+ const handleInputChange = (setter: React.Dispatch
>, e: string) => {
+ const newValue = e.replace(/\s+/g, '');
+ setter(newValue);
+ };
+
if (displayNameScreen === 1) {
return (
setPassword(e)}
- setRepassword={(e: any) => setRepassword(e)}
+ setPassword={(e: string) => handleInputChange(setPassword, e)}
+ setRepassword={(e: string) => handleInputChange(setRepassword, e)}
backArrow={goback}
submit={passValid}
/>
@@ -213,9 +223,7 @@ export const SignUpTab = (props: any) => {
-
- {window.i18n('displayName')}
-
+ {window.i18n('displayName')}
{
onDisplayNameChanged={(name: string) => {
const sanitizedName = sanitizeBchatUsername(name);
const trimName = sanitizedName.trim();
+ // const alphanumericName = sanitizedName.replace(/[^a-zA-Z0-9]/g, '');
setDisplayName(sanitizedName);
setDisplayNameError(!trimName ? window.i18n('displayNameEmpty') : undefined);
}}
stealAutoFocus={true}
/>
-
+
{
verifyUserName();
}}
buttonType={BchatButtonType.Default}
buttonColor={BchatButtonColor.Primary}
- text={window.i18n('continue')}
+ text={window.i18n('continue')}
disabled={!displayName}
/>
diff --git a/ts/components/settings/BchatRecoverySeed.tsx b/ts/components/settings/BchatRecoverySeed.tsx
index 49dc0074..8dd4b7d6 100644
--- a/ts/components/settings/BchatRecoverySeed.tsx
+++ b/ts/components/settings/BchatRecoverySeed.tsx
@@ -30,7 +30,6 @@ export const BchatRecoverySeed = (props: any) => {
};
const onClickCancelHandler = () => {
- console.log("sdnksnfksfkjf")
// if (props.onClickCancel) {
// onClickCancel();
// }
diff --git a/ts/components/settings/BchatSettings.tsx b/ts/components/settings/BchatSettings.tsx
index ad4ccf81..70ce06fc 100644
--- a/ts/components/settings/BchatSettings.tsx
+++ b/ts/components/settings/BchatSettings.tsx
@@ -283,7 +283,6 @@ export class BchatSettingsView extends React.Component
public render() {
const { category } = this.props;
- // console.log("category setting ::",category)
const shouldRenderPasswordLock = this.state.shouldLockSettings && this.state.hasPassword;
const categoryLocalized: LocalizerKeys =
category === BchatSettingCategory.Appearance
diff --git a/ts/components/settings/BchatSettingsHeader.tsx b/ts/components/settings/BchatSettingsHeader.tsx
index c64f1b82..077caee5 100644
--- a/ts/components/settings/BchatSettingsHeader.tsx
+++ b/ts/components/settings/BchatSettingsHeader.tsx
@@ -27,11 +27,7 @@ export const SettingsHeader = (props: Props) => {
const multipleSelectionValue = useSelector(getMultipleSelection);
const blockedNumbers = useSelector(getBlockedPubkeys);
- // console.log("multipleSelectionValue:", multipleSelectionValue);
- // console.log("blockedNumbers:", blockedNumbers)
// const temp=useSelector(state=>state)
- // console.log('multipleSelectionValue', multipleSelectionValue,temp);
-
// useEffect(() => {
// if (multipleSelectionValue) {
// color = 'var(--color-text)';
@@ -42,7 +38,7 @@ export const SettingsHeader = (props: Props) => {
// forceUpdate()
// }
// }, [multipleSelectionValue])
- console.log('categoryTitle -->',category,BchatSettingCategory.Wallet,)
+
if(category === BchatSettingCategory.Wallet)
{
return <>>
diff --git a/ts/components/settings/BlockedUserSettings.tsx b/ts/components/settings/BlockedUserSettings.tsx
index 3b78e89b..922087e8 100644
--- a/ts/components/settings/BlockedUserSettings.tsx
+++ b/ts/components/settings/BlockedUserSettings.tsx
@@ -188,7 +188,7 @@ const AvatarItem = (props: { memberPubkey: string; isAdmin: boolean; isBnsHolder
diff --git a/ts/components/settings/ChangeChatFontSetting.tsx b/ts/components/settings/ChangeChatFontSetting.tsx
index 7141888b..8f0960ab 100644
--- a/ts/components/settings/ChangeChatFontSetting.tsx
+++ b/ts/components/settings/ChangeChatFontSetting.tsx
@@ -41,7 +41,6 @@ export const ChangeChatFontSetting = (props: { onSliderChange?: (value: number)
currency: value,
onClose: () => dispatch(walletSettingMiniModal(null)),
onClick: (e: any) => {
- // console.log(e);
handleSlider(e)
},
})
diff --git a/ts/components/settings/ZoomingBchatSlider.tsx b/ts/components/settings/ZoomingBchatSlider.tsx
index 199bf813..d6aaeb82 100644
--- a/ts/components/settings/ZoomingBchatSlider.tsx
+++ b/ts/components/settings/ZoomingBchatSlider.tsx
@@ -43,7 +43,6 @@ export const ZoomingBchatSlider = (props: { onSliderChange?: (value: number) =>
const handleSlider = (valueToForward: any) => {
let value = valueToForward.substring(0, valueToForward.length - 1)
- console.log("value:",value)
props?.onSliderChange?.(value);
window.setSettingValue('zoom-factor-setting', value);
setValue(value)
@@ -104,7 +103,6 @@ export const ZoomingBchatSlider = (props: { onSliderChange?: (value: number) =>
currency: value + '%',
onClose: () => dispatch(walletSettingMiniModal(null)),
onClick: (e: any) => {
- console.log(e);
handleSlider(e)
},
})
diff --git a/ts/components/settings/section/categoryChat.tsx b/ts/components/settings/section/categoryChat.tsx
index f98c5011..7ecd8221 100644
--- a/ts/components/settings/section/categoryChat.tsx
+++ b/ts/components/settings/section/categoryChat.tsx
@@ -51,7 +51,6 @@ export const SettingsCategoryChat = (props: { hasPassword: boolean | null }) =>
function chatWithWallet() {
window.setSettingValue(SettingsKey.settingsChatWithWallet, !chatwithWallet);
// let contional:any=chatwithWallet;
- // console.log('contional::',contional)
// dispatch(updateWalletSyncInitiatedWithChat(contional)) ;
let data: any = false;
diff --git a/ts/components/wallet/BchatWalletMainPanel.tsx b/ts/components/wallet/BchatWalletMainPanel.tsx
index 2a65f35e..b3c7416f 100644
--- a/ts/components/wallet/BchatWalletMainPanel.tsx
+++ b/ts/components/wallet/BchatWalletMainPanel.tsx
@@ -51,8 +51,9 @@ export const WalletMainPanel = () => {
}
function numberOnly(e: any) {
- const re = /^\d+\.?\d*$/;
- if (e === '' || re.test(e)) {
+ // const re = /^\d+\.?\d*$/;
+ const pattern = /^(\d{0,16}(\.\d{1,5})?|(\d{0,16}\.))$/;
+ if (e === '' || pattern.test(e)) {
setAmount(e);
}
}
@@ -120,7 +121,6 @@ export const Dashboard = (props: any) => {
const focusedInnersection = useSelector((state: any) => state.walletInnerFocused);
let transactions = useSelector((state: any) => state.wallet.transacations);
const zoomLevel = window.getSettingValue('zoom-factor-setting');
- console.log('zoomLevel -->',zoomLevel,'window.innerWidth -->',window.innerWidth)
// daemon.daemonHeartbeat();
return (
<>
diff --git a/ts/components/wallet/BchatWalletModal.tsx b/ts/components/wallet/BchatWalletModal.tsx
index 78749e10..12c3900e 100644
--- a/ts/components/wallet/BchatWalletModal.tsx
+++ b/ts/components/wallet/BchatWalletModal.tsx
@@ -1,65 +1,114 @@
-import classNames from "classnames"
-import React, { useState } from "react"
-import { BchatButtonColor } from "../basic/BchatButton"
-import { SpacerSM } from "../basic/Text"
-import { BchatWrapperModal } from "../BchatWrapperModal"
-import { useKey } from "react-use"
-import { BchatIcon } from "../icon"
+import classNames from 'classnames';
+import React, { useState } from 'react';
+import { BchatButtonColor } from '../basic/BchatButton';
+import { SpacerSM } from '../basic/Text';
+import { BchatWrapperModal } from '../BchatWrapperModal';
+// import { useKey } from 'react-use';
+import { BchatIcon } from '../icon';
import { Constants } from '../../bchat';
-
export const WalletModal = (props: any) => {
- const [select, setSelect] = useState(props.currency);
- useKey((event: KeyboardEvent) => {
- props.onClick(select)
- return event.key === 'Enter';
- });
- return
-
{ props.onClick(select) }
- }}
- cancelButton={{
- status: true,
- text: window.i18n('cancel'),
- onClickCancelHandler: props.onClose
- }}
- >
-
-
-
- {props.content.length !== 0 && props.content.map((item: any, i: any) => <>
-
{
+ // props.onClick(select);
+ // return event.key === 'Enter';
+ // });
- onClick={() => setSelect(item)} >
-
- {select === item && (
-
- )}
-
- {item}
-
-
- >)}
-
- {/*
*/}
+ function search(sTerm: string) {
+ setSearchTerm(sTerm.trim());
+ if (sTerm.trim() !== '') {
+ const filtered = props.content.filter((item: any) =>
+ item.toLowerCase().includes(sTerm.toLowerCase())
+ );
+ setData(filtered);
+ } else {
+ setData(props.content);
+ }
+ }
+ return (
+
+
{
+ props.onClick(select);
+ },
+ }}
+ cancelButton={{
+ status: true,
+ text: window.i18n('cancel'),
+ onClickCancelHandler: props.onClose,
+ }}
+ >
+
+ {needSearch && (
+ <>
+
+
+
+
+
+
+
{
+ const inputValue = e.target.value;
+ search(inputValue);
+ }}
+ placeholder={'Search Currency'}
+ maxLength={26}
+ />
- {/*
*/}
- {/*
+
+ >
+ )}
+
+
+ {data?.length !== 0 &&
+ data.map((item: any, i: any) => (
+ <>
+
setSelect(item)}
+ >
+
+ {select === item && (
+
+ )}
+
+ {item}
+
+
+ >
+ ))}
+
+ {/*
*/}
+
+ {/* */}
+ {/* {
borderRadius: '5px'
}}
/> */}
- {/* {
}}
/> */}
- {/*
*/}
-
-
+ {/*
*/}
+
+
-}
\ No newline at end of file
+ );
+};
diff --git a/ts/components/wallet/BchatWalletReceivedForm.tsx b/ts/components/wallet/BchatWalletReceivedForm.tsx
index c7c5aece..e2f008e9 100644
--- a/ts/components/wallet/BchatWalletReceivedForm.tsx
+++ b/ts/components/wallet/BchatWalletReceivedForm.tsx
@@ -11,8 +11,9 @@ export const ReceivedForm = () => {
const qrValue = `Beldex:${walletAddress}?tx_amount=${txnAmount}`;
function validator(e: any) {
- const numbersValidation = /^\d+\.?\d*$/;
- if (e === '' || numbersValidation.test(e)) {
+ // const numbersValidation = /^\d+\.?\d*$/;
+ const pattern = /^(\d{0,16}(\.\d{1,5})?|(\d{0,16}\.))$/;
+ if (e === '' || pattern.test(e)) {
setTxnAmount(e);
}
}
diff --git a/ts/components/wallet/BchatWalletSendForm.tsx b/ts/components/wallet/BchatWalletSendForm.tsx
index 5335bf5b..835caf2a 100644
--- a/ts/components/wallet/BchatWalletSendForm.tsx
+++ b/ts/components/wallet/BchatWalletSendForm.tsx
@@ -34,7 +34,6 @@ export const SendForm = (props: any) => {
const BchatSendConfirmState = useSelector(getwalletSendConfirmModal);
const zoomLevel = window.getSettingValue('zoom-factor-setting');
const validZoomLevel=window.screen.width <= 1920 && zoomLevel>100;
- console.log('validZoomLevel -->',validZoomLevel,window.screen.width,window.screen.width <= 1920)
function clearStateValue() {
props.setAmount('');
@@ -68,7 +67,6 @@ export const SendForm = (props: any) => {
return event.key === 'Enter';
});
async function addressValidation() {
- // console.log("netConnetion()",netConnetion())
if (!window.globalOnlineStatus) {
ToastUtils.pushToastError('internetConnectionError', 'Please check your internet connection');
return;
diff --git a/ts/components/wallet/BchatWalletSettings.tsx b/ts/components/wallet/BchatWalletSettings.tsx
index ad685210..ff77bcd6 100644
--- a/ts/components/wallet/BchatWalletSettings.tsx
+++ b/ts/components/wallet/BchatWalletSettings.tsx
@@ -195,6 +195,7 @@ export const WalletSettings = () => {
headerName: window.i18n('displayCurrency'),
content: currenyExt,
currency: fiatCurrency,
+ needSearch:true,
onClose: () => dispatch(walletSettingMiniModal(null)),
onClick: (e: any) => {
window.setSettingValue(walletSettingsKey.settingsFiatCurrency, e);
diff --git a/ts/components/wallet/BchatWalletSyncSatusBar.tsx b/ts/components/wallet/BchatWalletSyncSatusBar.tsx
index e4ae80c0..d32ee5f5 100644
--- a/ts/components/wallet/BchatWalletSyncSatusBar.tsx
+++ b/ts/components/wallet/BchatWalletSyncSatusBar.tsx
@@ -24,11 +24,9 @@ const SyncStatusBar = () => {
if (currentDaemon?.type === 'Local') {
currentHeight = useSelector((state: any) => state.daemon.height);
daemonHeight = Number(useSelector(getHeight));
- // console.log('currentDaemon?.type ::', currentDaemon?.type, currentHeight, daemonHeight)
} else {
currentHeight = Number(useSelector(getHeight));
daemonHeight = useSelector((state: any) => state.daemon.height);
- // console.log('currentDaemon sync ::', currentDaemon?.type, currentHeight, daemonHeight)
}
let pct: any =
diff --git a/ts/components/wallet/BchatWalletTransactionSection.tsx b/ts/components/wallet/BchatWalletTransactionSection.tsx
index 678a7315..bd8efcba 100644
--- a/ts/components/wallet/BchatWalletTransactionSection.tsx
+++ b/ts/components/wallet/BchatWalletTransactionSection.tsx
@@ -142,7 +142,6 @@ export const TransactionSection = (props: any) => {
}
function searchTransaction(filteredTransaction: any) {
- // console.log("filteredTransaction ::",searchText)
let data =
filteredTransaction.length > 0
? filteredTransaction.filter(
@@ -174,10 +173,12 @@ export const TransactionSection = (props: any) => {
const modalRef = useRef
(null);
return (
- 100?'unset':''}}>
+
100 ? 'unset' : '' }}>
(visible ? setVisible(false) : '')}>
-
-
+
+
{
/>
{window.i18n('transactions')}
-
+
{transactionsHistory.length !== 0 || searchText ? (
-
- 125 && innerWidth<1920?'38px':'',marginTop:'15px'}}>
- 125 && innerWidth<1920?'unset':'right' }}
+ 125 && innerWidth < 1920 ? '38px' : '',
+ marginTop: '15px',
+ }} >
+
- {moment.unix(item.timestamp).format('ll HH:mm')}
-
-
- Height : {item.height}{' '}
- {item.type === 'out' || item.type === 'in' ? '(confirmed)' : ''}
-
-
-
+ 125 && innerWidth < 1920 ? 'unset' : 'right',
+ }}
+ >
+ {moment.unix(item.timestamp).format('ll HH:mm')}
+
+
+ Height : {item.height}{' '}
+ {item.type === 'out' || item.type === 'in' ? '(confirmed)' : ''}
+
+
+
+
{selected === i && (
diff --git a/ts/interactions/conversations/unsendingInteractions.ts b/ts/interactions/conversations/unsendingInteractions.ts
index 1c91a7bf..fb0812cc 100644
--- a/ts/interactions/conversations/unsendingInteractions.ts
+++ b/ts/interactions/conversations/unsendingInteractions.ts
@@ -336,6 +336,18 @@ export async function deleteMessagesByIdForEveryone(
await Promise.all(messageIds.map(m => getMessageById(m, false)))
);
+ const isContainInCommingMsgs = selectedMessages.some(msg => {
+ if (!msg.isOutgoing()) {
+ ToastUtils.pushToastError('', 'Please select an incoming message');
+ return true;
+ }
+ return false;
+ });
+
+ if (isContainInCommingMsgs) {
+ return;
+ }
+
const messageCount = selectedMessages.length;
const moreThanOne = messageCount > 1;
@@ -371,7 +383,7 @@ export async function deleteMessagesById(messageIds: Array
, conversation
window.inboxStore?.dispatch(
updateConfirmModal({
// title: window.i18n('deleteJustForMe'),
- title:"Delete selected messages?",
+ title: 'Delete selected messages?',
message: moreThanOne
? window.i18n('deleteMessagesQuestion', [messageCount.toString()])
: window.i18n('deleteMessageQuestion'),
diff --git a/ts/mains/main_renderer.tsx b/ts/mains/main_renderer.tsx
index 714beb5c..b0deb996 100644
--- a/ts/mains/main_renderer.tsx
+++ b/ts/mains/main_renderer.tsx
@@ -166,8 +166,6 @@ Storage.onready(async () => {
}
const themeSetting = window.Events.getThemeSetting();
-
- // console.log("themeSetting ",themeSetting);
const newThemeSetting = mapOldThemeToNew(themeSetting);
window.Events.setThemeSetting(newThemeSetting);
@@ -407,7 +405,6 @@ async function connect() {
.catch(err => {
throw new HTTPError('beldex_rpc_port', err);
});
- // console.log('connectCount === 0 && navigator.onLine:', connectCount, navigator.onLine);
// Bootstrap our online/offline detection, only the first time we connect
if (connectCount === 0 && navigator.onLine) {
window.addEventListener('offline', onOffline);
diff --git a/ts/models/message.ts b/ts/models/message.ts
index 7cc250fa..d9e0ceae 100644
--- a/ts/models/message.ts
+++ b/ts/models/message.ts
@@ -273,29 +273,19 @@ export class MessageModel extends Backbone.Model {
return basicProps;
}
public getPropsForPayment(): PropsForPayment | null {
- // console.log("this.istxnDetails() ::0",this.istxnDetails(),!this.isPayment())
if (!this.isPayment() && !this.istxnDetails()) {
- // console.log("this.istxnDetails() ::1",this.istxnDetails())
return null;
}
// else if (!this.istxnDetails()) {
- // console.log("this.istxnDetails() ::1",this.istxnDetails())
// return null;
// }
-
- // console.log("this.istxnDetails() ::2",this.get('txnDetails'))
-
const Payment = this.get('payment') || this.get('txnDetails');
- // console.log("this.istxnDetails() ::3",Payment)
-
let direction = this.get('direction');
if (!direction) {
direction = this.get('type') === 'outgoing' ? 'outgoing' : 'incoming';
}
-
-
return {
amount: Payment.amount,
txnId: Payment.txnId,
@@ -1315,7 +1305,6 @@ export class MessageModel extends Backbone.Model {
{
let amount=this.getMessageModelProps()?.propsForPayment?.amount;
let direction=this.getMessageModelProps()?.propsForPayment?.direction === "outgoing"?"Send":'Received'
- // console.log('Payment Details ::',this.isPayment(),this.getMessageModelProps()?.propsForPayment?.amount,`${amount}BDX ${direction}`)
return `${amount} BDX ${direction}`;
}
diff --git a/ts/node/sql.ts b/ts/node/sql.ts
index 0ffd9707..31a98175 100644
--- a/ts/node/sql.ts
+++ b/ts/node/sql.ts
@@ -1712,8 +1712,6 @@ function createOrUpdateItem(data: StorageItem, instance?: BetterSqlite3.Database
createOrUpdate(ITEMS_TABLE, data, instance);
}
function getItemById(id: string) {
- // console.log('getItemById:::muna');
-
return getById(ITEMS_TABLE, id);
}
function getAllItems() {
@@ -1972,9 +1970,7 @@ function getConversationById(id: string) {
if (!row) {
return null;
- }
- // console.log('getConversationById',row);
-
+ }
return jsonToObject(row.json);
}
@@ -2899,9 +2895,6 @@ function getAllUnprocessed() {
.prepare('SELECT * FROM unprocessed ORDER BY timestamp ASC;')
.all();
- // console.log('getAllUnprocessed ::',rows);
- // window.log.warn('getAllUnprocessed ::',rows)
- // window.log.info("getAllUnprocessed dat ::")
return rows;
}
@@ -3793,8 +3786,6 @@ function fillWithTestData(numConvosToAdd: number, numMsgsToAdd: number) {
function saveRecipientAddress(data: any) {
const { tx_hash,address } = data;
- // console.log("RecipientAddress ::5",data);
-
// if () {
// throw new Error(`saveReceipientAddress: id was falsey: ${id}`);
// }
@@ -3813,15 +3804,11 @@ function saveRecipientAddress(data: any) {
address,
tx_hash,
});
- console.log("RecipientAddress ::6 and end",);
-
- console.log('addRecipientAddress');
return ;
}
// function saveRecipientAddressvalid(data:any)
// {
-// console.log("RecipientAddress ::2",data);
// // data.json=JSON.stringify(data);
// const { address } = data;
@@ -3830,11 +3817,8 @@ function saveRecipientAddress(data: any) {
// .get({
// address
// });
-// console.log("RecipientAddress ::3",row);
// if (!row) {
-// console.log("RecipientAddress ::4",data);
-
// saveRecipientAddress(data)
// }
// }
diff --git a/ts/receiver/contentMessage.ts b/ts/receiver/contentMessage.ts
index df4b31a3..f5206d46 100644
--- a/ts/receiver/contentMessage.ts
+++ b/ts/receiver/contentMessage.ts
@@ -213,7 +213,6 @@ export async function decryptWithBchatProtocol(
// await conversation.commit();
// if (getConversation && getConversation.walletAddress) {
- // console.log('yes');
// if (
// getConversation.walletAddress ==
// 'bxbxYJsQ5G9PUgHnD89PwTRLxxUKG16uCeVXKY4s1a8ihiXDCiiohJoKQL5nxPjfWk5hz9Xztr6XX7yBsgtfiXuQ2qkZLiWPn'
@@ -224,14 +223,14 @@ export async function decryptWithBchatProtocol(
// walletAddress: beldexFinalAddress,
// };
// let updateConversation: any = await updateConversationAddress(data);
- // console.log('updateConversation:', updateConversation);
+ //
// }
// localStorage.setItem('senderWalletAddress', beldexFinalAddress);
// } else {
// localStorage.setItem('senderWalletAddress', getConversation.walletAddress);
// }
// } else {
- // console.log('no');
+ //
// localStorage.setItem('senderWalletAddress', beldexFinalAddress);
// }
// if (
diff --git a/ts/state/ducks/modalDialog.tsx b/ts/state/ducks/modalDialog.tsx
index 16786ec2..dd39b3d9 100644
--- a/ts/state/ducks/modalDialog.tsx
+++ b/ts/state/ducks/modalDialog.tsx
@@ -38,7 +38,8 @@ export type walletSettingMiniModalState={
content:any,
onClose:any,
onClick:any,
- currency:string
+ currency:string,
+ needSearch?:boolean
} | null;
export type TransactionInitModalState={} | null;
diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts
index 87b41ba5..680dca50 100644
--- a/ts/state/selectors/conversations.ts
+++ b/ts/state/selectors/conversations.ts
@@ -1073,7 +1073,6 @@ export const getIsMessageSelected = createSelector(
}
const { id } = props.propsForMessage;
-// console.log('selectedIds selectedIds::',selectedIds)
return selectedIds.includes(id);
}
);
diff --git a/ts/util/notifications.ts b/ts/util/notifications.ts
index 18d368b6..e0cce7b1 100644
--- a/ts/util/notifications.ts
+++ b/ts/util/notifications.ts
@@ -211,7 +211,6 @@ function update(forceRefresh = false) {
window.drawAttention();
// if (status.shouldPlayNotificationSound) {
- // console.log(sound)
// if (!sound) {
// sound = new Audio('sound/new_message.mp3');
// }
diff --git a/ts/wallet/daemon-rpc.ts b/ts/wallet/daemon-rpc.ts
index cae508bc..4ed1d769 100644
--- a/ts/wallet/daemon-rpc.ts
+++ b/ts/wallet/daemon-rpc.ts
@@ -46,21 +46,11 @@ class Daemon {
}
daemonHeartbeat() {
- // console.log('updateDaemonupdateDaemon::0');
- // const dispatch = useDispatch();
- // console.log('updateDaemonupdateDaemon::1');
-
clearInterval(this.heartbeat);
- // console.log('updateDaemonupdateDaemon::2');
-
this.heartbeat = setInterval(() => {
this.sendRPC('get_info').then(data => {
- // console.log('updateDaemonupdateDaemon::3', data);
if (!data.hasOwnProperty('error')) {
- // console.log('updateDaemonupdateDaemon::4', data.result.height);
window.inboxStore?.dispatch(updateDaemon({ height: data.result.height }));
-
- // window dispatch(updateDaemon({ height: data.result.height }));
}
});
}, 3000);
diff --git a/ts/wallet/wallet-rpc.ts b/ts/wallet/wallet-rpc.ts
index c006dd9c..2dc55abb 100644
--- a/ts/wallet/wallet-rpc.ts
+++ b/ts/wallet/wallet-rpc.ts
@@ -84,7 +84,6 @@ class Wallet {
startWallet = async (type?: string) => {
try {
- // console.log('start wallet rpc :', type);
let getFiatCurrency = window.getSettingValue(walletSettingsKey.settingsFiatCurrency);
if (!getFiatCurrency) {
window.setSettingValue(walletSettingsKey.settingsFiatCurrency, 'USD');
@@ -208,9 +207,7 @@ class Wallet {
});
wallet.stdout.on('close', (code: any) => {
process.stderr.write(`Wallet: exited with code ${code} \n`);
- // if (code === null) {
- // console.log("Failed to start wallet RPC");
- // }
+
});
} catch (error) {
console.log('failed to start wallet rpc', error);
@@ -455,10 +452,10 @@ class Wallet {
window.inboxStore?.dispatch(updateWalletHeight(response.result.height));
} else if (n.method == 'getbalance') {
let transacationsHistory: any = [];
- if (type == 'wallet') {
+ // if (type == 'wallet') {
transacationsHistory = await this.getTransactions();
transacationsHistory = transacationsHistory.transactions.tx_list;
- }
+ // }
if (
this.wallet_state.balance == response.result.balance &&
this.wallet_state.unlocked_balance == response.result.unlocked_balance &&
@@ -655,7 +652,6 @@ class Wallet {
};
})
.catch((error: any) => {
- // console.log('ERRORRRRRR:', error);
return {
method: method,
params: params,