mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-05 18:20:39 -08:00
parent
f1ac503a96
commit
105b87f981
1 changed files with 25 additions and 21 deletions
|
|
@ -18,6 +18,7 @@ export class DeepLinkService implements IDeepLinkService {
|
|||
*/
|
||||
private readonly deepLinkHandler: (requestUrl: string) => Promise<void> = async (requestUrl) => {
|
||||
logger.info(`Receiving deep link`, { requestUrl, function: 'deepLinkHandler' });
|
||||
try {
|
||||
// hostname is workspace id or name
|
||||
const { hostname, hash, pathname } = new URL(requestUrl);
|
||||
let workspace = await this.workspaceService.get(hostname);
|
||||
|
|
@ -42,6 +43,9 @@ export class DeepLinkService implements IDeepLinkService {
|
|||
tiddlerName = decodeURIComponent(tiddlerName);
|
||||
logger.info(`Open deep link`, { workspaceId: workspace.id, tiddlerName, function: 'deepLinkHandler' });
|
||||
await this.workspaceService.openWorkspaceTiddler(workspace, tiddlerName);
|
||||
} catch (error) {
|
||||
logger.error(`Invalid URL`, { requestUrl, error, function: 'deepLinkHandler' });
|
||||
}
|
||||
};
|
||||
|
||||
public initializeDeepLink(protocol: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue