blob: 104aa2d83c2db278d77b0f2c5771a53ffb28d6c0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import { BrowserWindow } from 'electron';
export default function handleDeepLink(
window: BrowserWindow,
rawUrl: string,
): void {
if (!rawUrl) {
return;
}
const url = rawUrl.replace('ferdium://', '');
// The next line is a workaround after this 71c5237 [chore: Mobx & React-Router upgrade (#406)].
// For some reason, the app won't start until because it's trying to route to './build'.
// TODO: Check what is wrong with DeepLinking - it is broken for some reason. This is causing several troubles.
const workaroundDeepLink = ['./build', '--allow-file-access-from-files'];
if (!url || workaroundDeepLink.includes(url)) return;
window.webContents.send('navigateFromDeepLink', { url });
}
|