Skip to content

Commit

Permalink
fix cold start fs links and incoming-share link (keybase#22881)
Browse files Browse the repository at this point in the history
  • Loading branch information
songgao authored Mar 4, 2020
1 parent 25b2f31 commit c21254c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions shared/actions/config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,34 @@ const routeToInitialScreen = (state: Container.TypedState) => {

// A deep link
if (state.config.startupLink) {
if (Platform.isIOS && state.config.startupLink === 'keybase://incoming-share') {
return [
RouteTreeGen.createSwitchLoggedIn({loggedIn: true}),
RouteTreeGen.createSwitchTab({tab: Tabs.peopleTab}),
RouteTreeGen.createNavigateAppend({path: ['iosChooseTarget']}),
]
}

if (
['keybase://private', 'keybase://public', 'keybase://team'].some(prefix =>
state.config.startupLink.startsWith(prefix)
)
) {
try {
const decoded = decodeURIComponent(state.config.startupLink.substr('keybase://'.length))
return [
RouteTreeGen.createSwitchLoggedIn({loggedIn: true}),
RouteTreeGen.createSwitchTab({tab: Tabs.fsTab}),
RouteTreeGen.createNavigateAppend({
path: [{props: {path: `/keybase/${decoded}`}, selected: 'main'}],
}),
]
} catch (e) {
logger.warn("Coudn't decode KBFS URI")
return []
}
}

try {
const url = new URL(state.config.startupLink)
const username = Constants.urlToUsername(url)
Expand Down

0 comments on commit c21254c

Please sign in to comment.