Skip to content

Commit

Permalink
fix: offline repo handling
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Nov 11, 2021
1 parent 1e21969 commit 873aa15
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ appl
const [hasUserPreviouslyStoredCode, setHasUserPreviouslyStoredCode] = useState(false);

useEffect(() => {
if (application.getIsOfflineActivationCodeStoredPreviously()) {
if (application.hasOfflineRepo()) {
setHasUserPreviouslyStoredCode(true);
}
}, [application]);
Expand All @@ -35,7 +35,7 @@ export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ appl
const handleSubscriptionCodeSubmit = async (event: TargetedEvent<HTMLFormElement, Event>) => {
event.preventDefault();

const result = await application.setOfflineFeatures(activationCode);
const result = await application.setOfflineFeaturesCode(activationCode);

if (result?.error) {
await application.alertService.alert(result.error);
Expand All @@ -47,7 +47,7 @@ export const OfflineSubscription: FunctionalComponent<IProps> = observer(({ appl
};

const handleRemoveOfflineKey = async () => {
await application.removeOfflineActivationCode();
await application.deleteOfflineFeatureRepo();

setIsSuccessfullyActivated(false);
setHasUserPreviouslyStoredCode(false);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "standard-notes-web",
"version": "3.9.1",
"version": "3.9.2",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
Expand Down Expand Up @@ -72,7 +72,7 @@
"@reach/listbox": "^0.16.2",
"@standardnotes/features": "1.8.1",
"@standardnotes/sncrypto-web": "1.5.3",
"@standardnotes/snjs": "2.17.4",
"@standardnotes/snjs": "2.17.5",
"mobx": "^6.3.5",
"mobx-react-lite": "^3.2.1",
"preact": "^10.5.15",
Expand Down
19 changes: 13 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2166,13 +2166,20 @@
dependencies:
"@standardnotes/auth" "^3.8.1"

"@standardnotes/[email protected]", "@standardnotes/features@^1.8.1":
"@standardnotes/[email protected]":
version "1.8.1"
resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.8.1.tgz#addea86a8a4288a0046bc674a8e76f1bac3c2f89"
integrity sha512-yDbMLu9SnwR4cmjsIMgpxBOK9kIbWVQ7WezfJ5MN0FAwD2IbfKCMaWBMUJStCtSqkKE4dkL3BC+sIxik/4RwdQ==
dependencies:
"@standardnotes/common" "^1.2.1"

"@standardnotes/features@^1.8.2":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.8.2.tgz#ecc8162ca80ee3740468aa55a64c23b519c13505"
integrity sha512-EYeYYT/WBIh7fMVTVhsy0INjVdyHVtnH90pbZQHNPpsUkLdj05DzuyxUKjsc0oxiskmZjPOVSfXt8l3RL5Av4g==
dependencies:
"@standardnotes/common" "^1.2.1"

"@standardnotes/settings@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@standardnotes/settings/-/settings-1.2.1.tgz#4c7656ea86d784a2f77c70acc89face5d28da024"
Expand All @@ -2192,15 +2199,15 @@
buffer "^6.0.3"
libsodium-wrappers "^0.7.9"

"@standardnotes/[email protected].4":
version "2.17.4"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.4.tgz#ebf9d59a297ee7d87db1631e8850ba53dd9e7bea"
integrity sha512-ucxhSG8scDZd+JguK0bPLNwSg99w+jpYnCM+RZpd6GTkVjHBy3DEFnM06KrDzubLAtbKE8b7I50DOI+5C4p2rg==
"@standardnotes/[email protected].5":
version "2.17.5"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.17.5.tgz#19382b6d29947d896d543c7824a6129547196540"
integrity sha512-sdqcavG5C46VybOq2aQ8bEDEGvXE3sjjcwJJBVsTWCANQkFFh0k7gTA3y3n9ZiWncjoYpBOpuvwr6wpBwJE8EA==
dependencies:
"@standardnotes/auth" "^3.8.1"
"@standardnotes/common" "^1.2.1"
"@standardnotes/domain-events" "^2.5.1"
"@standardnotes/features" "^1.8.1"
"@standardnotes/features" "^1.8.2"
"@standardnotes/settings" "^1.2.1"
"@standardnotes/sncrypto-common" "^1.5.2"

Expand Down

0 comments on commit 873aa15

Please sign in to comment.