feat: fetch features and store locally for offline users (#706)

* feat: fetch features and store locally for offline users

* feat: handle success and error cases

* refactor: move offline activation code reading/validation to snjs

* chore: update after renaming snjs function

* fix: correct condition for checking offline users

* feat: let users remove their previous offline keys (WIP)

* refactor: handle setOfflineFeatures function response accordingly

* feat: remove corresponding local data when removing offline key

* fix: use snjs' confirm dialog instead of custom one

* feat: show warning before installing extension from untrusted source

* refactor: move functions for validating external feature url and checking if custom server host was used to snjs

* chore: put correct snjs version

* chore: make `eslint-plugin-react-hooks` in yarn.lock to match the `develop` branch

* chore: deps update

* chore: deps update
This commit is contained in:
Vardan Hakobyan
2021-11-03 22:27:36 +04:00
committed by GitHub
parent bad87a4f2f
commit 04fab80adb
7 changed files with 171 additions and 14 deletions

View File

@@ -0,0 +1,26 @@
import { FunctionalComponent } from 'preact';
import { PreferencesGroup, PreferencesSegment, Title } from '@/preferences/components';
import { OfflineSubscription } from '@/preferences/panes/account/offlineSubscription';
import { WebApplication } from '@/ui_models/application';
import { observer } from 'mobx-react-lite';
import { AppState } from '@/ui_models/app_state';
interface IProps {
application: WebApplication;
appState: AppState;
}
export const Advanced: FunctionalComponent<IProps> = observer(({ application, appState }) => {
return (
<PreferencesGroup>
<PreferencesSegment>
<div className='flex flex-row items-center'>
<div className='flex-grow flex flex-col'>
<Title>Advanced Settings</Title>
<OfflineSubscription application={application} appState={appState} />
</div>
</div>
</PreferencesSegment>
</PreferencesGroup>
);
});