Skip to content

Commit

Permalink
fix: update app init
Browse files Browse the repository at this point in the history
Post breaking changes from dependencies
  • Loading branch information
acezard committed Aug 6, 2021
1 parent 606aa28 commit bc793cc
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 109 deletions.
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"devDependencies": {
"@testing-library/react": "9.5.0",
"@testing-library/react-hooks": "3.7.0",
"@babel/preset-env": "^7.15.0",
"@babel/preset-typescript": "^7.15.0",
"babel-jest": "24.9.0",
"babel-preset-cozy-app": "1.11.0",
"enzyme": "3.11.0",
Expand All @@ -52,14 +54,11 @@
"@atlaskit/icon": "21.1.0",
"@atlaskit/media-core": "32.2.0",
"@atlaskit/smart-card": "14.8.5",
"@babel/preset-env": "^7.14.7",
"@babel/preset-typescript": "^7.14.5",
"@babel/runtime": "^7.0.0",
"@material-ui/core": "4.12.3",
"@material-ui/styles": "4.11.4",
"classnames": "2.3.1",
"cozy-bar": "7.16.0",
"cozy-client": "23.18.0",
"cozy-client": "23.18.1",
"cozy-device-helper": "1.12.0",
"cozy-doctypes": "1.82.2",
"cozy-editor-core": "134.0.3",
Expand All @@ -75,11 +74,10 @@
"react-dom": "16.12.0",
"react-intl": "2.9.0",
"react-router-dom": "5.2.0",
"react-select": "4.3.1",
"rxjs": "5.5.12",
"styled-components": "3.4.10",
"url-search-params-polyfill": "7.0.1",
"utf-8-validate": "5.0.2"
"utf-8-validate": "5.0.5"
},
"resolutions": {
"prosemirror-model": "1.11.0"
Expand Down
11 changes: 6 additions & 5 deletions src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ const App = ({ isPublic }) => {
const { isMobile } = useBreakpoints
const { ClientErrors } = useClientErrors()

let appName = ''
if (isMobile) {
const data = client.getInstanceOptions()
appName = getDataOrDefault(data.app.name, manifest.name)
}
const appName = isMobile
? getDataOrDefault(client.getInstanceOptions().app.name, manifest.name)
: ''

const { BarCenter } = cozy.bar

const FlagSwitcher = useFlagSwitcher()

return (
<BreakpointsProvider>
<HashRouter>
Expand Down
5 changes: 3 additions & 2 deletions src/lib/debug.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { useEffect } from 'react'
import { useFlag } from 'cozy-flags'
import useFlag from 'cozy-flags/dist/useFlag'
import FlagSwitcher from 'cozy-flags/dist/FlagSwitcher'
import set from 'lodash/set'
import get from 'lodash/get'
import flag, { FlagSwitcher } from 'cozy-flags'
import flag from 'cozy-flags'

import { getVersion, sendableSteps } from 'prosemirror-collab'

Expand Down
73 changes: 43 additions & 30 deletions src/targets/browser/index.ejs
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
<!DOCTYPE html>
<html lang="{{.Locale}}">
<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2">
<% if (__TARGET__ !== 'mobile') { %>
<link rel="stylesheet" type="text/css" href="//{{.Domain}}/assets/fonts/fonts.css">
<% } %>
<meta name="theme-color" content="#ffffff">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, viewport-fit=cover">
<% _.forEach(htmlWebpackPlugin.files.css, function(file) { %>
<link rel="stylesheet" href="<%- file %>">
<% }); %>
<% _.forEach(htmlWebpackPlugin.files.js, function(file) { %>
<script src="<%- file %>" defer></script>
<% }); %>
<% if (__TARGET__ === 'mobile') { %>
<meta name="format-detection" content="telephone=no">
<script src="cordova.js" defer></script>
<% } else if (__STACK_ASSETS__) { %>
{{.CozyBar}}
<% } %>
</head>
<div
role="application"
data-cozy="{{.CozyData}}"
>
<head>
<meta charset="utf-8" />
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link
rel="icon"
type="image/png"
href="./favicon-32x32.png"
sizes="32x32"
/>
<link
rel="icon"
type="image/png"
href="./favicon-16x16.png"
sizes="16x16"
/>
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2" />
<% if (__TARGET__ !== 'mobile') { %>
<link
rel="stylesheet"
type="text/css"
href="//{{.Domain}}/assets/fonts/fonts.css"
/>
<% } %>
<meta name="theme-color" content="#ffffff" />
<meta
name="viewport"
content="width=device-width, height=device-height, initial-scale=1, viewport-fit=cover"
/>
<% _.forEach(htmlWebpackPlugin.files.css, function(file) { %>
<link rel="stylesheet" href="<%- file %>" />
<% }); %> <% _.forEach(htmlWebpackPlugin.files.js, function(file) { %>
<script src="<%- file %>" defer></script>
<% }); %> <% if (__TARGET__ === 'mobile') { %>
<meta name="format-detection" content="telephone=no" />
<script src="cordova.js" defer></script>
<% } else if (__STACK_ASSETS__) { %>
{{.CozyBar}}
<% } %>
</head>
<div role="application" data-cozy="{{.CozyData}}"></div>
</html>
Loading

0 comments on commit bc793cc

Please sign in to comment.