Page MenuHomePhabricator

[Cashtab] Move webapp specific functions to conditionally loaded component
ClosedPublic

Authored by bytesofman on Dec 14 2023, 23:39.

Details

Summary

Big goal here is to have only one App.js file to maintain. We want this file to build the Extension app if an extension env var is set, and the webapp if not.

In this diff, move webapp-specific logic into its own component, WebApp.js. Conditionally include this component at build time if you are not building the extension.

Test Plan

Change monitorExtension boolean to true in src/config/app.js. npm start and note your extension intallation status in the dev console.
npm run build, then netlify deploy to a new URL. Load the URL. Confirm you get a request to enable notifications. Confirm persistent storage status in the log.

Reviewing code, confirm that WebApp.js is just copy pasted of what is removed from App.js

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cashtab-one-app-js-one
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25969
Build 51512: Build Diffcashtab-tests
Build 51511: arc lint + arc unit

Event Timeline

PiRK requested changes to this revision.Dec 15 2023, 08:53
PiRK added a subscriber: PiRK.

Move-only commit for the code confirmed with git show --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space

Just a few layout nits to report

cashtab/src/components/AppModes/WebApp.js
10

you added a blank space here after the *

102

add a newline before this line

This revision now requires changes to proceed.Dec 15 2023, 08:53
This revision is now accepted and ready to land.Dec 15 2023, 14:24