54 Commits

Author SHA1 Message Date
Eric Mastro
ee1287b71d fix: prevent crash on generate account wrong password
Fixes #2448.

Currently, if a wrong password is entered when generating a wallet account, the app will crash due to attempting to decode a `GeneratedAccount ` from an rpc response containing only an error.

With this PR, we are detecting if an error is returned in the response, and if so, raising a StatusGoException. This exception is caught in the call chain, and translated in to a `StatusGoError` which is serialised and sent to the QML view, where it is parsed and displayed as an invalid password error in the input box.

refactor: remove string return values as error messages in wallet model
In the wallet model, we were passing back empty strings for no error, or an error as a string. This is not only confusing, but does not benefit from leaning on the compiler and strong types. One has to read the entire code to understand if a string result is returned when there is no error instead of implicitly being able to understand there is no return type.

To alleviate this, account creation fundtions that do not need to return a value have been changed to a void return type, and raise `StatusGoException` if there is an error encountered. This can be caught in the call chain and used as necessary (ie to pass to QML).

refactor: move invalid password string detection to Utils
Currently, we are reading returned view model values and checking to see if they include a known string from Status Go that means there was an invalid password used. This string was placed in the codebased in mulitple locations.

This PR moves the string check to a Utils function and updates all the references to use the function in Utils.
2021-05-14 10:27:37 -04:00
Eric Mastro
daabef3a3c fix: do not show watch-only accounts as “from address”
Fixes: #2257.

If a user had selected a watch-only address in the wallet, the backend `walletModel.currentAccount` property would also change. When loading a transaction modal, this property was used to set the `selectedAccount` value for the “from” `AccountSelector`, regardless if the account was a watch-only address.

This PR updates the logic for `selectedAccount` such that it will only allow the account to be selected if it is not a watch-only account.
2021-04-29 12:36:39 -04:00
Pascal Precht
aa8d9a7f48 feat: introduce StatusLoadingIndicator component
A `StatusIcon` that rotates infinitely and can be used for indicating
pending states.

Usage:

```
StatusLoadingIndicator {
    width: 24 // default: 17
    height: 24 // default: 17
    color: "red" // default: loading asset color
}
```

This also removes `LoadingImage` component from `ui/shared`.

Closes #2360
2021-04-27 14:56:09 -04:00
Jonathan Rainville
ea802a95d7 fix(TransactionModal): fix values oferflowing
Fixes #1872
Elides those values and adds a tooltip to show them completely
2021-04-20 13:20:34 -04:00
Jonathan Rainville
bf67c941ff fix: improve profile sections min width and scaling 2021-04-13 15:05:51 -04:00
rinzlxr
0abaa61067 fix: typos and switch statement string literals
remove console log

fix last typo
2021-03-25 15:00:13 -04:00
Iuri Matias
3d2eaa3369 remove various titles from profile sections 2021-03-24 14:45:17 -04:00
rinzlxr
47ae3a4c16 ens section fixes
use the available dark image for ens section

add the image, ensure 624 widths and fix button

move common strings to constants and use number consts
2021-03-24 14:09:59 -04:00
Jonathan Rainville
b9594591b0 fix: fix a lot of issues relative to dark theme
Fixes #1997
2021-03-16 17:22:58 -04:00
Jonathan Rainville
0e699cac65 chore: run translation scripts 2021-02-18 15:23:58 -05:00
Pascal Precht
62183fb414 refactor: replace StyledButton with StatusButton
There are some inconcistencies in the application when it comes to
button UI elements because we're using `StatusButton` in some places,
in other we use `StyledButton`. The latter is the original
component we've created when we started out building Status
Desktop, but is planned to be removed entirely in favour of
`StatusButton`.

This commit replaces the usages of `StyledButton` with `StatusButton`
2021-02-02 10:57:42 +01:00
Jonathan Rainville
e459d4dbd4 fix: fix PopupModal to not show a footer at all if there is no children 2021-01-13 14:32:35 -05:00
Jonathan Rainville
89da5dd923 feat: open links in user request browser with modal 2021-01-04 15:29:23 -05:00
Pascal Precht
e11139df12 feat: make UserNameLabel render local nick names and ENS names
In timeline status update messages we want to render the ENS name next to a
local nickname in case it exists. This commit extends the `UsernameLabel` to do
just that.

Closes #1488
2020-12-10 12:30:31 +01:00
Richard Ramos
ae30d04010 refactor: ProfileView 2020-12-08 17:01:22 -05:00
Richard Ramos
3f12320764 feat: checkbox style 2020-12-01 13:30:58 -05:00
Richard Ramos
159c82c329 feat: choose network 2020-11-26 11:44:49 -05:00
emizzle
e0e1487643 refactor: replace transaction modal reset functionality
The transaction component's `reset` functionality was meant ot reset a form when the modal was closed. It was difficult to manage and added extra overhead for each additional transaction modal created.

Instead of using reset functions, we can use Loaders to load and destroy the modal's as they are opened and closed. We do not need to keep them in memory and then also reset their functions. It creates a smaller memory footprint to destroy the object and reload on open.

feat: load gas prediction prices asynchronously
2020-11-26 11:17:24 -05:00
RichΛrd
d601df179d
Add right anchor to chatText on ENS section 2020-11-19 21:15:36 -04:00
Richard Ramos
1737fc2506 fix: mangled ens name 2020-11-19 16:59:57 -05:00
Pascal Precht
2aac433a3d refactor: get rid off AddButton and make use of StatusRoundButton instead 2020-11-19 16:52:32 -05:00
emizzle
423882df89
fix: 1:1 chat command transactions "intrinsic gas too low"
I noticed that the 1:1 chat commands were not able to send token transactions due to "intrinsic gas too low" error. I quickly realised there there were a few components missing, which have been fixed.

*feat: update the 1:1 chat commands transaction modal to allow editing of the from account and network fee*

The TransactionStackGroup was updated slightly to allow manual control of back/next actions.

Fixes #870.

*fix: Create distinct modal transaction actions*

Previously, adding `Connection`s for the  `walletModel.transactionWasSent` signal in different dialogs would cause the signal to be handled in the wrong dialog. The solution was to pass a `uuid` from the requesting dialog, and include the `uuid` in the response, so that only requests that were requested from the dialog would be handled.

*fix: update 1:1 translations*
All the translations were not being translated for me. I noticed that they did not exist in the `.ts` translation files either.
2020-10-28 11:07:21 +01:00
Jonathan Rainville
9f9bad2fa3 feat: add a read more button and crop text when message is too long 2020-09-29 14:02:33 -04:00
emizzle
1fc0e26a0f fix: update tx modal validity 2020-09-29 13:27:29 -04:00
hydr063n
d41bae62f7 fix: convert styledbuttons to statusbuttons 2020-09-29 13:25:25 -04:00
hydr063n
a1dbf306e4 fix: apply correct theme and use correct model to access functions 2020-09-29 13:25:25 -04:00
hydr063n
6ffa4ef4fa fix: update Text to StyledText 2020-09-29 11:41:44 -04:00
hydr063n
aa43d54acc fix: ens modal wordwrap and text color 2020-09-29 11:41:44 -04:00
hydr063n
968923e8be chore: refactor ensRegisterAddress too and update the ui to use utilsModel 2020-09-28 10:38:23 -04:00
Jonathan Rainville
81f5e4e7d8 chore: update translations 2020-09-23 17:19:57 -04:00
Richard Ramos
16468960f7 fix: code review 2020-09-22 09:37:41 -04:00
Richard Ramos
efac44057a fix: rebase gone wrong 2020-09-22 09:37:41 -04:00
Richard Ramos
346e98c81a feat: Add transaction modal when changing the pubkey 2020-09-22 09:37:41 -04:00
Pascal Precht
f0939a01fe chore: update i18n 2020-09-18 17:23:35 -04:00
Pascal Precht
e0adc3056e chore: update translations
Closes #801 #841
2020-09-17 15:16:09 -04:00
emizzle
7b0d3c496c fix: exception handling in mutli-threaded transactions
Currently, exceptions thrown during transactions or gas estimation that were spawned in another thread are not being propagated, due to a limitation in nim (see https://nim-lang.org/docs/manual_experimental.html#parallel-amp-spawn).

This means any exceptions from status-go were not propagated correctly and would cause the app to crash. This includes entering the wrong password when trying to send a transaction.

The issue was addressed by passing a `success` variable by reference, which is set to false if an exception was thrown by status-go.
2020-09-17 12:21:29 -04:00
Richard Ramos
24e01ffa7c fix: code review 2020-09-16 14:22:29 -04:00
RichΛrd
6a42124489 Apply suggestions from code review
Co-authored-by: Eric Mastro <eric.mastro@gmail.com>
2020-09-16 14:22:29 -04:00
Richard Ramos
e46ab433f4 feat: transaction dialog for registering ENS name 2020-09-16 14:22:29 -04:00
Richard Ramos
f2a56c70e1 fix: rebase gone wrong 2020-09-11 13:25:55 -04:00
Richard Ramos
d134ef8e45 fix: disable on testnet 2020-08-28 11:31:35 -04:00
Richard Ramos
7d4c4ac4c7 feat: change pubkeys for already owned ens usernames 2020-08-28 11:31:35 -04:00
Richard Ramos
fad0a91933 feat: register status ens usernames 2020-08-28 11:31:35 -04:00
Richard Ramos
7df357dcf7 feat: show terms and conditions, add ens registry contract, and determine if you have enough SNT balance. 2020-08-28 11:31:35 -04:00
Richard Ramos
8f1f01b6a0 feat: register status ens usernames 2020-08-28 11:31:35 -04:00
Richard Ramos
ce8cd4183f feat: show terms and conditions, add ens registry contract, and determine if you have enough SNT balance. 2020-08-28 11:06:12 -04:00
Jonathan Rainville
0c686c3fcf chore: run qstrConverter script 2020-08-27 17:09:37 -04:00
Richard Ramos
e96f3ed47f
fix: display ens names with correct format in all screens 2020-08-11 08:39:07 -04:00
Richard Ramos
0e6653968f fix: code review 2020-08-10 10:27:56 -04:00
Richard Ramos
71fee14add feat: show ENS username details 2020-08-10 10:27:56 -04:00