lightning-browser-extension icon indicating copy to clipboard operation
lightning-browser-extension copied to clipboard

Namespace and type extension "utils" calls

Open escapedcat opened this issue 3 years ago • 0 comments

Is your feature request related to a problem?

We currently use normal string to call actions within the extension i.e.:

    await utils.call("editAccount", {
      name,
      id,
    });
  • https://github.com/getAlby/lightning-browser-extension/blob/master/src/app/screens/Accounts/index.tsx#L43
  • https://github.com/getAlby/lightning-browser-extension/blob/master/src/common/lib/utils.ts#L13
  • https://github.com/getAlby/lightning-browser-extension/blob/master/src/types.ts#L102

Describe the solution you'd like

  • Instead of just use strings try to use types
  • Instead of just writing editAccount namespace these types, i.e. account/add

Describe alternatives you've considered

none

Additional context

We should do this for all bigger action-groups

  • [ ] account
  • [ ] allowance
  • [ ] blocklist
  • [ ] think about ho to namespace non-groped actions if needed

Are you working on this?

No

escapedcat avatar Jun 21 '22 03:06 escapedcat