Navigation Menu

Skip to content

Commit

Permalink
move to deeplinks
Browse files Browse the repository at this point in the history
  • Loading branch information
cjb committed Feb 25, 2020
1 parent 8aab2ee commit 1eec539
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
15 changes: 6 additions & 9 deletions shared/actions/deeplinks-gen.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions shared/actions/deeplinks.tsx
@@ -1,7 +1,8 @@
import * as ChatGen from './chat2-gen'
import * as Constants from '../constants/config'
import * as Container from '../util/container'
import * as CryptoTypes from '../'
import * as CryptoGen from '../actions/crypto-gen'
import * as CryptoTypes from '../constants/types/crypto'
import * as DeeplinksGen from './deeplinks-gen'
import * as Platform from '../constants/platform'
import * as ProfileGen from './profile-gen'
Expand All @@ -10,6 +11,7 @@ import * as Saga from '../util/saga'
import * as Tabs from '../constants/tabs'
import * as WalletsGen from './wallets-gen'
import * as TeamsGen from './teams-gen'
import HiddenString from '../util/hidden-string'
import URL from 'url-parse'
import logger from '../logger'

Expand Down Expand Up @@ -135,7 +137,7 @@ const handleAppLink = (state: Container.TypedState, action: DeeplinksGen.LinkPay
return false
}

const handleFile = (state: Container.TypedState, action: DeeplinksGen.FilePayload) => {
const handleFile = (action: DeeplinksGen.HandleFilePayload) => {
let operation: CryptoTypes.Operations
const {path} = action.payload
if (path.endsWith('.encrypted.saltpack')) {
Expand All @@ -144,13 +146,13 @@ const handleFile = (state: Container.TypedState, action: DeeplinksGen.FilePayloa
operation = 'verify'
} else {
console.warn('Received a filename with an unknown extension: ', path)
return
return false
}
return DeeplinksGen.createSetInputThrottled({operation, type: 'file', value: new HiddenString(path)})
return CryptoGen.createSetInputThrottled({operation, type: 'file', value: new HiddenString(path)})
}

function* deeplinksSaga() {
yield* Saga.chainAction2(DeeplinksGen.handleFile, handleFile)
yield* Saga.chainAction(DeeplinksGen.handleFile, handleFile)
yield* Saga.chainAction2(DeeplinksGen.link, handleAppLink)
yield* Saga.chainAction(DeeplinksGen.handleKeybaseLink, handleKeybaseLink)
}
Expand Down
2 changes: 1 addition & 1 deletion shared/actions/json/deeplinks.json
@@ -1,7 +1,7 @@
{
"prelude": [],
"actions": {
"handleFileLink": {"path": "string"},
"handleFile": {"path": "string"},
"handleKeybaseLink": {"link": "string"},
"link": {"link": "string"},
"setKeybaseLinkError": {
Expand Down
2 changes: 1 addition & 1 deletion shared/actions/typed-actions-gen.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1eec539

Please sign in to comment.