tangled
alpha
login
or
join now
vt3e.cat
/
bbell
11
fork
atom
wip bsky client for the web & android
bbell.vt3e.cat
11
fork
atom
overview
issues
pulls
pipelines
feat: deep linking :D
vt3e.cat
2 months ago
e784ab23
673507a3
verified
This commit was signed with the committer's
known signature
.
vt3e.cat
SSH Key Fingerprint:
SHA256:MaVgF6bXxDdD131G4rXizPh+sttp3IVsdPrj48HV0X0=
+41
-3
4 changed files
expand all
collapse all
unified
split
.gitignore
android
app
src
main
AndroidManifest.xml
src
App.vue
stores
navigation.ts
+1
.gitignore
···
1
1
.android-sdk
2
2
+
_keep/
2
3
3
4
# Logs
4
5
logs
+7
android/app/src/main/AndroidManifest.xml
···
22
22
<category android:name="android.intent.category.LAUNCHER" />
23
23
</intent-filter>
24
24
25
25
+
<intent-filter android:autoVerify="true">
26
26
+
<action android:name="android.intent.action.VIEW" />
27
27
+
<category android:name="android.intent.category.DEFAULT" />
28
28
+
<category android:name="android.intent.category.BROWSABLE" />
29
29
+
<data android:scheme="https" android:host="bbell.vt3e.cat" />
30
30
+
</intent-filter>
31
31
+
25
32
</activity>
26
33
27
34
<provider
+9
-1
src/App.vue
···
1
1
<script setup lang="ts">
2
2
import { onMounted, computed, ref, onUnmounted } from 'vue'
3
3
-
import { App } from '@capacitor/app'
3
3
+
import { App, type URLOpenListenerEvent } from '@capacitor/app'
4
4
5
5
import { useNavigationStore } from './stores/navigation'
6
6
import { useEnvironmentStore } from './stores/environment'
···
64
64
App.addListener('backButton', handleBackNavigation)
65
65
document.addEventListener('keyup', (e) => {
66
66
if (e.key === 'e' && e.altKey) handleBackNavigation()
67
67
+
})
68
68
+
69
69
+
App.addListener('appUrlOpen', function (event: URLOpenListenerEvent) {
70
70
+
const slug = event.url.split('https://bbell.vt3e.cat').pop()
71
71
+
console.log(slug, window.location.href, event)
72
72
+
if (!slug) return
73
73
+
if (slug.startsWith('/oauth/callback')) isCallback.value = true
74
74
+
else nav.navigateToUrl(slug)
67
75
})
68
76
69
77
theme.init()
+24
-2
src/stores/navigation.ts
···
228
228
}
229
229
}
230
230
231
231
-
function parseUrl() {
232
232
-
const path = window.location.pathname
231
231
+
function parseUrl(path: string = window.location.pathname) {
233
232
const searchParams = new URLSearchParams(window.location.search)
234
233
235
234
const match = matchPageByPath(path)
···
286
285
isInitialized.value = true
287
286
}
288
287
288
288
+
function navigateToUrl(path: string) {
289
289
+
const { page, root, props } = parseUrl(path)
290
290
+
291
291
+
console.log(page, root, props)
292
292
+
activeTab.value = 'home'
293
293
+
294
294
+
const stack = stacks.value['home']
295
295
+
const rootEntry = stack[0]
296
296
+
if (!rootEntry) return
297
297
+
298
298
+
const subPageEntry: StackEntry = {
299
299
+
id: generateId(page),
300
300
+
page: page as PageKey,
301
301
+
props,
302
302
+
}
303
303
+
304
304
+
stacks.value['home'] = [rootEntry, subPageEntry]
305
305
+
updateHistory('replace', 'home', rootEntry)
306
306
+
updateHistory('push', 'home', subPageEntry)
307
307
+
}
308
308
+
289
309
return {
290
310
activeTab,
291
311
stacks,
292
312
canGoBack,
293
313
pendingPop,
314
314
+
parseUrl,
315
315
+
navigateToUrl,
294
316
init,
295
317
switchTab,
296
318
resetTab,