forked from coracle/flotilla
Split app/core up into domain-oriented files
This commit is contained in:
@@ -5,7 +5,7 @@ import {session} from "@welshman/app"
|
||||
import type {Session} from "@welshman/app"
|
||||
import {maybe, now} from "@welshman/lib"
|
||||
import type {Filter} from "@welshman/util"
|
||||
import {pushState} from "@app/core/state"
|
||||
import {pushState} from "@app/push/adapters/common"
|
||||
import type {IPushAdapter} from "@app/push/adapters/common"
|
||||
import {requestPermissions, syncRelaySubscriptions} from "@app/push/adapters/common"
|
||||
|
||||
|
||||
@@ -12,7 +12,10 @@ import {assoc, hash, maybe} from "@welshman/lib"
|
||||
import type {Filter} from "@welshman/util"
|
||||
import {DELETE, getRelaysFromList, makeEvent, Address} from "@welshman/util"
|
||||
import {buildUrl} from "@lib/util"
|
||||
import {PUSH_BRIDGE, PUSH_SERVER, pushState, userSpaceUrls, device} from "@app/core/state"
|
||||
import {PUSH_BRIDGE, PUSH_SERVER} from "@app/env"
|
||||
import {pushState} from "@app/push/adapters/common"
|
||||
import {userSpaceUrls} from "@app/groups"
|
||||
import {device} from "@app/device"
|
||||
import type {IPushAdapter} from "@app/push/adapters/common"
|
||||
import {
|
||||
onPushNotificationAction,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import {withGetter} from "@welshman/store"
|
||||
import {writable} from "svelte/store"
|
||||
import {goto} from "$app/navigation"
|
||||
import type {Subscriber, Unsubscriber} from "svelte/store"
|
||||
import {
|
||||
@@ -21,18 +23,24 @@ import {
|
||||
type Filter,
|
||||
type TrustedEvent,
|
||||
} from "@welshman/util"
|
||||
import {
|
||||
DM_KINDS,
|
||||
CONTENT_KINDS,
|
||||
notificationSettings,
|
||||
pushState,
|
||||
shouldNotify,
|
||||
userSpaceUrls,
|
||||
userSettingsValues,
|
||||
makeCommentFilter,
|
||||
} from "@app/core/state"
|
||||
import {DM_KINDS, CONTENT_KINDS, makeCommentFilter} from "@app/content"
|
||||
import {notificationSettings, shouldNotify, userSettingsValues} from "@app/settings"
|
||||
import {userSpaceUrls} from "@app/groups"
|
||||
import {makeSpacePath, getEventPath} from "@app/routes"
|
||||
|
||||
export type PushSubscription = {
|
||||
key: string
|
||||
callback: string
|
||||
}
|
||||
|
||||
export type PushState = {
|
||||
token?: string
|
||||
useFallback?: boolean
|
||||
subscription?: PushSubscription
|
||||
}
|
||||
|
||||
export const pushState = withGetter(writable<PushState>({}))
|
||||
|
||||
export interface IPushAdapter {
|
||||
request: (prompt?: boolean) => Promise<string>
|
||||
disable: () => Promise<void>
|
||||
|
||||
@@ -2,7 +2,8 @@ import {pubkey} from "@welshman/app"
|
||||
import {maybe} from "@welshman/lib"
|
||||
import type {Unsubscriber} from "svelte/store"
|
||||
import {getPubkeyTagValues, matchFilter, type TrustedEvent} from "@welshman/util"
|
||||
import {DM_KINDS, notificationSettings} from "@app/core/state"
|
||||
import {DM_KINDS} from "@app/content"
|
||||
import {notificationSettings} from "@app/settings"
|
||||
import type {IPushAdapter} from "@app/push/adapters/common"
|
||||
import {onNotification} from "@app/push/adapters/common"
|
||||
import {goToEvent} from "@app/routes"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {Capacitor} from "@capacitor/core"
|
||||
import {notificationSettings, pushState} from "@app/core/state"
|
||||
import {notificationSettings} from "@app/settings"
|
||||
import {pushState} from "@app/push/adapters/common"
|
||||
import {WebNotifications} from "@app/push/adapters/web"
|
||||
import {CapacitorNotifications} from "@app/push/adapters/capacitor"
|
||||
import {AndroidFallbackNotifications} from "@app/push/adapters/android"
|
||||
|
||||
Reference in New Issue
Block a user