lint(deeplink): clean up and lint files

This commit is contained in:
George Lima 2019-02-18 22:56:40 -03:00
parent a5d0a51155
commit d67b1f7a65
8 changed files with 19 additions and 14 deletions

View File

@ -48,7 +48,7 @@ type State = {
const TIME_DELAY_ANIM = 100;
export class Component extends PureComponent<Props, State> {
state = { start: false, message: 'ZEC Wallet Starting' };
state = { start: false };
componentDidMount() {
setTimeout(() => {

View File

@ -4,7 +4,7 @@ import React, { type ComponentType, Component } from 'react';
import { ipcRenderer, remote } from 'electron';
import { type RouterHistory, type Location } from 'react-router-dom';
import { searchUriInArgv } from '../../config/handle-deeplink';
import electronStore from "../../config/electron-store"
import electronStore from '../../config/electron-store';
type PassedProps = {
history: RouterHistory,
@ -12,13 +12,16 @@ type PassedProps = {
isRunning: boolean,
};
const OSX_DEEPLINK_URL_KEY = "OSX_DEEPLINK_URL"
const OSX_DEEPLINK_URL_KEY = 'OSX_DEEPLINK_URL';
export const withDeepLink = (
WrappedComponent: ComponentType<PassedProps>,
): ComponentType<$Diff<PassedProps, {}>> => class extends Component<PassedProps> {
componentDidMount() {
const arg = searchUriInArgv([...remote.process.argv, electronStore.get(OSX_DEEPLINK_URL_KEY) || ""]);
const arg = searchUriInArgv([
...remote.process.argv,
electronStore.get(OSX_DEEPLINK_URL_KEY) || '',
]);
if (arg) this.redirect(arg);
@ -40,7 +43,7 @@ export const withDeepLink = (
// clean osx deeplink storage
if (electronStore.has(OSX_DEEPLINK_URL_KEY)) {
electronStore.delete(OSX_DEEPLINK_URL_KEY)
electronStore.delete(OSX_DEEPLINK_URL_KEY);
}
history.replace(`/send/${message.replace(/zcash:(\/\/)?/, '')}`);

View File

@ -104,7 +104,7 @@ if (instanceLock) {
app.quit();
}
handleDeeplink({ app, mainWindow })
handleDeeplink({ app, mainWindow });
/* eslint-disable-next-line consistent-return */
app.on('ready', async () => {

View File

@ -1,6 +1,6 @@
// @flow
import { typeof app as ElectronApp, type electron$BrowserWindow, remote } from 'electron'; // eslint-disable-line
import store from "./electron-store"
import store from './electron-store';
const sendMessage = (mainWindow, url) => {
if (mainWindow) {
@ -31,7 +31,8 @@ export const handleDeeplink = ({
if (listenOpenUrl) {
app.on('open-url', (event: Object, url: string) => {
event.preventDefault();
store.set("OSX_DEEPLINK_URL", url)
// Save the url on electron-store, so we can get the value on withDeeplink HOC
store.set('OSX_DEEPLINK_URL', url);
sendMessage(mainWindow, url);
});
}

View File

@ -66,7 +66,7 @@
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.12.4",
"file-loader": "^2.0.0",
"flow-bin": "^0.92.1",
"flow-bin": "^0.93.0",
"flow-coverage-report": "^0.6.1",
"flow-typed": "^2.5.1",
"glow": "^1.2.2",

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="81" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="81" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h34v20H0z"/><path fill="#E05D44" d="M34 0h47v20H34z"/><path fill="url(#b)" d="M0 0h81v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,DejaVu Sans,Geneva,sans-serif" font-size="11"><text x="17" y="15" fill="#010101" fill-opacity=".3">flow</text><text x="17" y="14">flow</text><text x="56.5" y="15" fill="#010101" fill-opacity=".3">failing</text><text x="56.5" y="14">failing</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="88" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="88" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h34v20H0z"/><path fill="#4C1" d="M34 0h54v20H34z"/><path fill="url(#b)" d="M0 0h88v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,DejaVu Sans,Geneva,sans-serif" font-size="11"><text x="17" y="15" fill="#010101" fill-opacity=".3">flow</text><text x="17" y="14">flow</text><text x="60" y="15" fill="#010101" fill-opacity=".3">passing</text><text x="60" y="14">passing</text></g></svg>

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 726 B

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="125" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="125" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h91v20H0z"/><path fill="#4C1" d="M91 0h34v20H91z"/><path fill="url(#b)" d="M0 0h125v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,DejaVu Sans,Geneva,sans-serif" font-size="11"><text x="45.5" y="15" fill="#010101" fill-opacity=".3">flow-coverage</text><text x="45.5" y="14">flow-coverage</text><text x="107" y="15" fill="#010101" fill-opacity=".3">89%</text><text x="107" y="14">89%</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="125" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="a"><rect width="125" height="20" rx="3" fill="#fff"/></mask><g mask="url(#a)"><path fill="#555" d="M0 0h91v20H0z"/><path fill="#4C1" d="M91 0h34v20H91z"/><path fill="url(#b)" d="M0 0h125v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,DejaVu Sans,Geneva,sans-serif" font-size="11"><text x="45.5" y="15" fill="#010101" fill-opacity=".3">flow-coverage</text><text x="45.5" y="14">flow-coverage</text><text x="107" y="15" fill="#010101" fill-opacity=".3">88%</text><text x="107" y="14">88%</text></g></svg>

Before

Width:  |  Height:  |  Size: 745 B

After

Width:  |  Height:  |  Size: 745 B

View File

@ -6408,9 +6408,10 @@ flow-annotation-check@1.8.1:
glob "7.1.1"
load-pkg "^3.0.1"
flow-bin@^0.92.1:
version "0.92.1"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.92.1.tgz#32c136c07235f30c42dc0549a0790f370fad4070"
flow-bin@^0.93.0:
version "0.93.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.93.0.tgz#9192a08d88db2a8da0ff55e42420f44539791430"
integrity sha512-p8yq4ocOlpyJgOEBEj0v0GzCP25c9WP0ilFQ8hXSbrTR7RPKuR+Whr+OitlVyp8ocdX0j1MrIwQ8x28dacy1pg==
flow-coverage-report@^0.6.1:
version "0.6.1"