Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nik api integration with node #83

Merged
merged 7 commits into from
Feb 8, 2021
Merged

Conversation

wirednkod
Copy link
Contributor

Solves #65

@wirednkod wirednkod requested review from Stefie, goldsteinsveta and raoulmillais and removed request for Stefie February 5, 2021 16:14
@raoulmillais
Copy link
Contributor

raoulmillais commented Feb 5, 2021

I'm getting this error in the chrome devtools on the history page:

16:28:52.811 Error: system.account(AccountId) is a map, requiring 1 argument, 0 found
    at assert (assert.js:34)
    at doMap (validate.js:33)
    at extractStorageArgs (validate.js:46)
    at decorateMethod.methodName (Decorate.js:414)
    at index.js:86
    at new Promise (<anonymous>)
    at decorateSubscribe (index.js:82)
    at Object.account (index.js:101)
    at useUserInfo.ts:19
    at invokePassiveEffectCreate (react-dom.development.js:23487)

@wirednkod
Copy link
Contributor Author

  • Refactored and use correctly the AccountContext (and relevant types/hooks) in order to retrieve and save from/to localStorage in an easy way.
  • Added extra checks for account not to break in case it is deleted from localStorage
  • Fix Burn
  • Remove unnecessary passing of functions from parent -> child components
  • Added custom "units" that are retrieved from chain or defaults to 'Unit'

@raoulmillais
Copy link
Contributor

I'm getting this error in the chrome devtools on the history page:

16:28:52.811 Error: system.account(AccountId) is a map, requiring 1 argument, 0 found
    at assert (assert.js:34)
    at doMap (validate.js:33)
    at extractStorageArgs (validate.js:46)
    at decorateMethod.methodName (Decorate.js:414)
    at index.js:86
    at new Promise (<anonymous>)
    at decorateSubscribe (index.js:82)
    at Object.account (index.js:101)
    at useUserInfo.ts:19
    at invokePassiveEffectCreate (react-dom.development.js:23487)

I can't reproduce this again now 🤔

@raoulmillais
Copy link
Contributor

I see "undefined" instead of the name of the unit in the history page:

2021-02-05_16:46:59

@wirednkod
Copy link
Contributor Author

I see "undefined" instead of the name of the unit in the history page:

2021-02-05_16:46:59

This is not fixed yet - will be fixed with issues #66 #67

@wirednkod
Copy link
Contributor Author

I'm getting this error in the chrome devtools on the history page:

16:28:52.811 Error: system.account(AccountId) is a map, requiring 1 argument, 0 found
    at assert (assert.js:34)
    at doMap (validate.js:33)
    at extractStorageArgs (validate.js:46)
    at decorateMethod.methodName (Decorate.js:414)
    at index.js:86
    at new Promise (<anonymous>)
    at decorateSubscribe (index.js:82)
    at Object.account (index.js:101)
    at useUserInfo.ts:19
    at invokePassiveEffectCreate (react-dom.development.js:23487)

I can't reproduce this again now 🤔

This was happening during some localstorage corruption. If you pull latest and clean localStorage this hopefully will not exist

@raoulmillais
Copy link
Contributor

I'm getting this error in the chrome devtools on the history page:

16:28:52.811 Error: system.account(AccountId) is a map, requiring 1 argument, 0 found
    at assert (assert.js:34)
    at doMap (validate.js:33)
    at extractStorageArgs (validate.js:46)
    at decorateMethod.methodName (Decorate.js:414)
    at index.js:86
    at new Promise (<anonymous>)
    at decorateSubscribe (index.js:82)
    at Object.account (index.js:101)
    at useUserInfo.ts:19
    at invokePassiveEffectCreate (react-dom.development.js:23487)

I can't reproduce this again now thinking

This was happening during some localstorage corruption. If you pull latest and clean localStorage this hopefully will not exist

Ideally this shouldn't error. Maybe do a sanity check on the contents of localStorage, clear it if it is in the wrong format and log a warning?

Copy link
Contributor

@raoulmillais raoulmillais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the error in the console when the local storage is the wrong format this LGTM 👍 I'm out of touch with react so I can't review properly for best practices and use of react though.

@wirednkod wirednkod merged commit 5860d19 into master Feb 8, 2021
@wirednkod wirednkod deleted the nik-api-integration-with-node branch February 8, 2021 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants