Compare commits

...

3 Commits

Author SHA1 Message Date
muzam1l
aae9c7468f Properly reset 'Destination' field while changing transaction type. 2022-08-03 16:44:27 +05:30
muzamil
fb9814ec76 Merge pull request #262 from XRPLF/fix/script-log-appending
Clear script log on running new script.
2022-08-03 14:33:59 +05:30
muzam1l
d459b2ee92 Clear script log on running new script. 2022-08-01 17:04:26 +05:30
3 changed files with 4 additions and 4 deletions

View File

@@ -143,7 +143,6 @@ const RunScript: React.FC<{ file: IFile }> = ({ file: { content, name } }) => {
setIframeCode(template);
state.scriptLogs = [
...snap.scriptLogs,
{ type: "success", message: "Started running..." },
];
} catch (err) {

View File

@@ -154,10 +154,12 @@ const Transaction: FC<TransactionProps> = ({
const nwState: Partial<TransactionState> = {
viewType,
selectedTransaction: transactionType,
selectedDestAccount: null
};
// Currently in schema "Destination": "SomeVal" means 'Destination is required' while empty string indicates it is optional
// TODO Update schema with clear required tag
if (fields.Destination !== undefined) {
nwState.selectedDestAccount = null;
fields.Destination = "";
} else {
fields.Destination = undefined;

View File

@@ -58,12 +58,11 @@ export const TxUI: FC<UIProps> = ({
const fields = getTxFields(tt);
if (fields.Destination !== undefined) {
setState({ selectedDestAccount: null });
fields.Destination = "";
} else {
fields.Destination = undefined;
}
return setState({ txFields: fields });
return setState({ txFields: fields, selectedDestAccount: null });
},
[setState]
);