-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Handle offline mode in Flagship app
We want mespapiers to be compatible with the new Flagship app's Offline mode When hosted in a Flagship app's WebView we now want to use FlagshipLink instead of StackLink in cozy-client This link will allow to redirect all queries to the Flagship app that will handle data access when offline but also when online Related PR: cozy/cozy-client#1507 Related PR: cozy/cozy-flagship-app#1239
- Loading branch information
Showing
5 changed files
with
78 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import { CaptureConsole } from '@sentry/integrations' | ||
import * as Sentry from '@sentry/react' | ||
import memoize from 'lodash/memoize' | ||
import { makeClient } from 'src/targets/browser/makeClient' | ||
|
||
import flag from 'cozy-flags' | ||
import { RealtimePlugin } from 'cozy-realtime' | ||
import { initTranslation } from 'cozy-ui/transpiled/react/providers/I18n' | ||
|
||
import manifest from '../../../manifest.webapp' | ||
|
@@ -20,9 +17,6 @@ const setupApp = memoize(() => { | |
const locale = JSON.parse(root.dataset.cozy)?.locale | ||
const lang = getDataOrDefault(locale, 'en') | ||
const polyglot = initTranslation(lang, lang => require(`locales/${lang}`)) | ||
const client = makeClient() | ||
client.registerPlugin(RealtimePlugin) | ||
client.registerPlugin(flag.plugin) | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/63', | ||
|
@@ -37,7 +31,7 @@ const setupApp = memoize(() => { | |
ignoreErrors: [/^Warning: /] | ||
}) | ||
|
||
return { root, client, lang, polyglot } | ||
return { root, lang, polyglot } | ||
}) | ||
|
||
export default setupApp |