mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-02-17 05:31:29 -08:00
refactor: better name for request open
This commit is contained in:
parent
d3616aa8ab
commit
54aa9cb7d9
8 changed files with 42 additions and 42 deletions
|
|
@ -100,8 +100,8 @@ const loadListeners = () => {
|
|||
}
|
||||
});
|
||||
|
||||
ipcMain.on('request-open-in-browser', (e, url) => {
|
||||
shell.openExternal(url);
|
||||
ipcMain.on('request-open', (e, uri) => {
|
||||
shell.openExternal(uri);
|
||||
});
|
||||
|
||||
// Find In Page
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import DialogContent from '@material-ui/core/DialogContent';
|
|||
|
||||
import connectComponent from '../../helpers/connect-component';
|
||||
|
||||
import { requestOpenInBrowser } from '../../senders';
|
||||
import { requestOpen } from '../../senders';
|
||||
|
||||
const styles = (theme) => ({
|
||||
icon: {
|
||||
|
|
@ -81,13 +81,13 @@ const About = (props) => {
|
|||
|
||||
|
||||
<Button
|
||||
onClick={() => requestOpenInBrowser('https://github.com/tiddly-gittly/TiddlyGit-Desktop')}
|
||||
onClick={() => requestOpen('https://github.com/tiddly-gittly/TiddlyGit-Desktop')}
|
||||
>
|
||||
Website
|
||||
</Button>
|
||||
<br />
|
||||
<Button
|
||||
onClick={() => requestOpenInBrowser('https://github.com/tiddly-gittly/TiddlyGit-Desktop/issues/new/choose')}
|
||||
onClick={() => requestOpen('https://github.com/tiddly-gittly/TiddlyGit-Desktop/issues/new/choose')}
|
||||
>
|
||||
Support
|
||||
</Button>
|
||||
|
|
@ -97,10 +97,10 @@ const About = (props) => {
|
|||
<span role="img" aria-label="love">❤</span>
|
||||
<span> by </span>
|
||||
<span
|
||||
onClick={() => requestOpenInBrowser('https://onetwo.ren/wiki/')}
|
||||
onClick={() => requestOpen('https://onetwo.ren/wiki/')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://onetwo.ren/wiki/');
|
||||
requestOpen('https://onetwo.ren/wiki/');
|
||||
}}
|
||||
role="link"
|
||||
tabIndex="0"
|
||||
|
|
@ -110,10 +110,10 @@ const About = (props) => {
|
|||
</span>
|
||||
<span> and </span>
|
||||
<span
|
||||
onClick={() => requestOpenInBrowser('https://atomery.com?utm_source=tiddlygit')}
|
||||
onClick={() => requestOpen('https://atomery.com?utm_source=tiddlygit')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://atomery.com?utm_source=tiddlygit');
|
||||
requestOpen('https://atomery.com?utm_source=tiddlygit');
|
||||
}}
|
||||
role="link"
|
||||
tabIndex="0"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import {
|
|||
getDesktopPath,
|
||||
countWorkspace,
|
||||
getWorkspaceRemote,
|
||||
requestOpenInBrowser,
|
||||
requestOpen,
|
||||
} from '../../senders';
|
||||
|
||||
const graphqlClient = new GraphQLClient({
|
||||
|
|
@ -128,7 +128,7 @@ export default function AddWorkspace() {
|
|||
同步到云端
|
||||
</Typography>
|
||||
{githubWikiUrl && (
|
||||
<GithubRepoLink onClick={() => requestOpenInBrowser(githubWikiUrl)} variant="subtitle2" align="center">
|
||||
<GithubRepoLink onClick={() => requestOpen(githubWikiUrl)} variant="subtitle2" align="center">
|
||||
({githubWikiUrl})
|
||||
</GithubRepoLink>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ import ListItemDefaultBrowser from './list-item-default-browser';
|
|||
import {
|
||||
requestCheckForUpdates,
|
||||
requestClearBrowsingData,
|
||||
requestOpenInBrowser,
|
||||
requestOpen,
|
||||
requestQuit,
|
||||
requestRealignActiveWorkspace,
|
||||
requestResetPreferences,
|
||||
|
|
@ -545,10 +545,10 @@ const Preferences = ({
|
|||
role="link"
|
||||
tabIndex={0}
|
||||
className={classes.link}
|
||||
onClick={() => requestOpenInBrowser('https://cliqz.com/en/whycliqz/adblocking')}
|
||||
onClick={() => requestOpen('https://cliqz.com/en/whycliqz/adblocking')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://cliqz.com/en/whycliqz/adblocking');
|
||||
requestOpen('https://cliqz.com/en/whycliqz/adblocking');
|
||||
}}
|
||||
>
|
||||
Cliqz
|
||||
|
|
@ -580,10 +580,10 @@ const Preferences = ({
|
|||
role="link"
|
||||
tabIndex={0}
|
||||
className={classes.link}
|
||||
onClick={() => requestOpenInBrowser('https://darkreader.org/')}
|
||||
onClick={() => requestOpen('https://darkreader.org/')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://darkreader.org/');
|
||||
requestOpen('https://darkreader.org/');
|
||||
}}
|
||||
>
|
||||
Dark Reader
|
||||
|
|
@ -859,10 +859,10 @@ const Preferences = ({
|
|||
role="link"
|
||||
tabIndex={0}
|
||||
className={classes.link}
|
||||
onClick={() => requestOpenInBrowser('https://github.com/atomery/webcatalog/wiki/How-to-Enable-Notifications-in-Web-Apps')}
|
||||
onClick={() => requestOpen('https://github.com/atomery/webcatalog/wiki/How-to-Enable-Notifications-in-Web-Apps')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://github.com/atomery/webcatalog/wiki/How-to-Enable-Notifications-in-Web-Apps');
|
||||
requestOpen('https://github.com/atomery/webcatalog/wiki/How-to-Enable-Notifications-in-Web-Apps');
|
||||
}}
|
||||
>
|
||||
Learn more
|
||||
|
|
@ -1023,10 +1023,10 @@ const Preferences = ({
|
|||
role="link"
|
||||
tabIndex={0}
|
||||
className={classes.link}
|
||||
onClick={() => requestOpenInBrowser('https://groups.google.com/a/chromium.org/d/msg/security-dev/mB2KJv_mMzM/ddMteO9RjXEJ')}
|
||||
onClick={() => requestOpen('https://groups.google.com/a/chromium.org/d/msg/security-dev/mB2KJv_mMzM/ddMteO9RjXEJ')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://groups.google.com/a/chromium.org/d/msg/security-dev/mB2KJv_mMzM/ddMteO9RjXEJ');
|
||||
requestOpen('https://groups.google.com/a/chromium.org/d/msg/security-dev/mB2KJv_mMzM/ddMteO9RjXEJ');
|
||||
}}
|
||||
>
|
||||
Learn more
|
||||
|
|
@ -1053,7 +1053,7 @@ const Preferences = ({
|
|||
<ChevronRightIcon color="action" />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem button onClick={() => requestOpenInBrowser('https://github.com/tiddly-gittly/TiddlyGit-Desktop/blob/master/PrivacyPolicy.md')}>
|
||||
<ListItem button onClick={() => requestOpen('https://github.com/tiddly-gittly/TiddlyGit-Desktop/blob/master/PrivacyPolicy.md')}>
|
||||
<ListItemText primary="Privacy Policy" />
|
||||
</ListItem>
|
||||
</List>
|
||||
|
|
@ -1243,7 +1243,7 @@ const Preferences = ({
|
|||
</Typography>
|
||||
<Paper elevation={0} className={classes.paper}>
|
||||
<List disablePadding dense>
|
||||
<ListItem button onClick={() => requestOpenInBrowser('https://webcatalogapp.com?utm_source=singlebox_app')}>
|
||||
<ListItem button onClick={() => requestOpen('https://webcatalogapp.com?utm_source=singlebox_app')}>
|
||||
<ListItemText
|
||||
primary={(<img src={webcatalogLogo} alt="WebCatalog" className={classes.logo} />)}
|
||||
secondary="Run Web Apps like Real Apps"
|
||||
|
|
@ -1251,7 +1251,7 @@ const Preferences = ({
|
|||
<ChevronRightIcon color="action" />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem button onClick={() => requestOpenInBrowser('https://singleboxapp.com?utm_source=singlebox_app')}>
|
||||
<ListItem button onClick={() => requestOpen('https://singleboxapp.com?utm_source=singlebox_app')}>
|
||||
<ListItemText
|
||||
primary={(<img src={singleboxLogo} alt="Singlebox" className={classes.logo} />)}
|
||||
secondary="All Your Apps in One Single Window"
|
||||
|
|
@ -1259,7 +1259,7 @@ const Preferences = ({
|
|||
<ChevronRightIcon color="action" />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem button onClick={() => requestOpenInBrowser('https://translatiumapp.com?utm_source=singlebox_app')}>
|
||||
<ListItem button onClick={() => requestOpen('https://translatiumapp.com?utm_source=singlebox_app')}>
|
||||
<ListItemText
|
||||
primary={(<img src={translatiumLogo} alt="Translatium" className={classes.logo} />)}
|
||||
secondary="Translate Any Languages like a Pro"
|
||||
|
|
@ -1279,12 +1279,12 @@ const Preferences = ({
|
|||
<ChevronRightIcon color="action" />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem button onClick={() => requestOpenInBrowser('https://tiddlygitapp.com?utm_source=tiddlygit_app')}>
|
||||
<ListItem button onClick={() => requestOpen('https://tiddlygitapp.com?utm_source=tiddlygit_app')}>
|
||||
<ListItemText primary="Website" />
|
||||
<ChevronRightIcon color="action" />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem button onClick={() => requestOpenInBrowser('https://atomery.com/support?app=tiddlygit&utm_source=tiddlygit_app')}>
|
||||
<ListItem button onClick={() => requestOpen('https://atomery.com/support?app=tiddlygit&utm_source=tiddlygit_app')}>
|
||||
<ListItemText primary="Support" />
|
||||
<ChevronRightIcon color="action" />
|
||||
</ListItem>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import ChevronRightIcon from '@material-ui/icons/ChevronRight';
|
|||
|
||||
import connectComponent from '../../helpers/connect-component';
|
||||
|
||||
import { requestOpenInBrowser } from '../../senders';
|
||||
import { requestOpen } from '../../senders';
|
||||
|
||||
const ListItemDefaultBrowser = () => {
|
||||
const [isDefault, setIsDefault] = useState(false);
|
||||
|
|
@ -69,7 +69,7 @@ const ListItemDefaultBrowser = () => {
|
|||
if (isWindows10) {
|
||||
return (
|
||||
// https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app
|
||||
<ListItem button onClick={() => requestOpenInBrowser('ms-settings:defaultapps')}>
|
||||
<ListItem button onClick={() => requestOpen('ms-settings:defaultapps')}>
|
||||
{sharedListItemText}
|
||||
<ChevronRightIcon color="action" />
|
||||
</ListItem>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import ChevronRightIcon from '@material-ui/icons/ChevronRight';
|
|||
|
||||
import connectComponent from '../../helpers/connect-component';
|
||||
|
||||
import { requestOpenInBrowser } from '../../senders';
|
||||
import { requestOpen } from '../../senders';
|
||||
|
||||
const ListItemDefaultMailClient = () => {
|
||||
const [isDefault, setIsDefault] = useState(false);
|
||||
|
|
@ -65,7 +65,7 @@ const ListItemDefaultMailClient = () => {
|
|||
if (isWindows10) {
|
||||
return (
|
||||
// https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app
|
||||
<ListItem button onClick={() => requestOpenInBrowser('ms-settings:defaultapps')}>
|
||||
<ListItem button onClick={() => requestOpen('ms-settings:defaultapps')}>
|
||||
<ListItemText primary="Default email client" secondary="Make TiddlyGit the default email client." />
|
||||
<ChevronRightIcon color="action" />
|
||||
</ListItem>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import {
|
|||
save,
|
||||
} from '../../state/dialog-proxy/actions';
|
||||
|
||||
import { requestOpenInBrowser } from '../../senders';
|
||||
import { requestOpen } from '../../senders';
|
||||
|
||||
const styles = (theme) => ({
|
||||
root: {
|
||||
|
|
@ -94,10 +94,10 @@ const DialogProxy = (props) => {
|
|||
role="link"
|
||||
tabIndex={0}
|
||||
className={classes.link}
|
||||
onClick={() => requestOpenInBrowser('https://www.npmjs.com/package/proxy-agent')}
|
||||
onClick={() => requestOpen('https://www.npmjs.com/package/proxy-agent')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://www.npmjs.com/package/proxy-agent');
|
||||
requestOpen('https://www.npmjs.com/package/proxy-agent');
|
||||
}}
|
||||
>
|
||||
Learn more
|
||||
|
|
@ -123,10 +123,10 @@ const DialogProxy = (props) => {
|
|||
role="link"
|
||||
tabIndex={0}
|
||||
className={classes.link}
|
||||
onClick={() => requestOpenInBrowser('https://www.electronjs.org/docs/api/session#sessetproxyconfig')}
|
||||
onClick={() => requestOpen('https://www.electronjs.org/docs/api/session#sessetproxyconfig')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://www.electronjs.org/docs/api/session#sessetproxyconfig');
|
||||
requestOpen('https://www.electronjs.org/docs/api/session#sessetproxyconfig');
|
||||
}}
|
||||
>
|
||||
Learn more
|
||||
|
|
@ -165,10 +165,10 @@ const DialogProxy = (props) => {
|
|||
role="link"
|
||||
tabIndex={0}
|
||||
className={classes.link}
|
||||
onClick={() => requestOpenInBrowser('https://en.wikipedia.org/wiki/Proxy_auto-config')}
|
||||
onClick={() => requestOpen('https://en.wikipedia.org/wiki/Proxy_auto-config')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://en.wikipedia.org/wiki/Proxy_auto-config');
|
||||
requestOpen('https://en.wikipedia.org/wiki/Proxy_auto-config');
|
||||
}}
|
||||
>
|
||||
Learn more
|
||||
|
|
@ -194,10 +194,10 @@ const DialogProxy = (props) => {
|
|||
role="link"
|
||||
tabIndex={0}
|
||||
className={classes.link}
|
||||
onClick={() => requestOpenInBrowser('https://www.electronjs.org/docs/api/session#sessetproxyconfig')}
|
||||
onClick={() => requestOpen('https://www.electronjs.org/docs/api/session#sessetproxyconfig')}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key !== 'Enter') return;
|
||||
requestOpenInBrowser('https://www.electronjs.org/docs/api/session#sessetproxyconfig');
|
||||
requestOpen('https://www.electronjs.org/docs/api/session#sessetproxyconfig');
|
||||
}}
|
||||
>
|
||||
Learn more
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ export const requestCreateSubWiki = (
|
|||
) => ipcRenderer.invoke('create-sub-wiki', newFolderPath, folderName, mainWikiToLink, onlyLink);
|
||||
export const ensureWikiExist = (wikiPath: string, shouldBeMainWiki: boolean) =>
|
||||
ipcRenderer.invoke('ensure-wiki-exist', wikiPath, shouldBeMainWiki);
|
||||
export const requestOpenInBrowser = url => ipcRenderer.send('request-open-in-browser', url);
|
||||
export const requestShowMessageBox = (message, type) => ipcRenderer.send('request-show-message-box', message, type);
|
||||
export const requestLoadUrl = (url, id) => ipcRenderer.send('request-load-url', url, id);
|
||||
export const requestOpen = (uri: string) => ipcRenderer.send('request-open', uri);
|
||||
export const requestShowMessageBox = (message: string, type: string) => ipcRenderer.send('request-show-message-box', message, type);
|
||||
export const requestLoadUrl = (url: string, id: string) => ipcRenderer.send('request-load-url', url, id);
|
||||
|
||||
export const requestGoHome = () => ipcRenderer.send('request-go-home');
|
||||
export const requestGoBack = () => ipcRenderer.send('request-go-back');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue