Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
Enjoy toooting! This version includes following improvements and fixes: | ||
- Added Belarusian language |
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,2 +1 @@ | ||
toooting愉快!此版本包括以下改进和修复: | ||
- 新增白俄罗斯语 |
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,6 +1,6 @@ | ||
{ | ||
"name": "tooot", | ||
"version": "4.9.1", | ||
"version": "4.9.2", | ||
"description": "tooot for Mastodon", | ||
"author": "xmflsct <[email protected]>", | ||
"license": "GPL-3.0-or-later", | ||
|
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import openLink from '@components/openLink' | ||
import navigationRef from '@utils/navigation/navigationRef' | ||
import { getReadableAccounts, setAccount } from '@utils/storage/actions' | ||
import * as Linking from 'expo-linking' | ||
import { useEffect } from 'react' | ||
|
||
// /compose OR /compose/@[email protected] | ||
|
||
export const useLinking = () => { | ||
const parseLink = async (link: string) => { | ||
const parsed = Linking.parse(link) | ||
|
||
switch (parsed.scheme) { | ||
case 'tooot': | ||
if (parsed.hostname === 'compose') { | ||
if (parsed.path?.length) { | ||
const accounts = getReadableAccounts() | ||
const foundNotActiveAccount = accounts.find( | ||
account => account.acct === parsed.path && !account.active | ||
) | ||
if (foundNotActiveAccount) { | ||
await setAccount(foundNotActiveAccount.key) | ||
} | ||
} | ||
navigationRef.navigate('Screen-Compose') | ||
} | ||
break | ||
case 'https': | ||
case 'http': | ||
await openLink(link) | ||
break | ||
} | ||
} | ||
|
||
useEffect(() => { | ||
Linking.getInitialURL().then(parseLink) | ||
|
||
const listener = Linking.addEventListener('url', ({ url }) => parseLink(url)) | ||
return () => listener.remove() | ||
}, []) | ||
} |