Add filestorage adapters
This commit is contained in:
@@ -62,7 +62,6 @@
|
||||
import {
|
||||
loadRelay,
|
||||
db,
|
||||
initStorage,
|
||||
repository,
|
||||
pubkey,
|
||||
session,
|
||||
@@ -70,7 +69,6 @@
|
||||
signer,
|
||||
signerLog,
|
||||
dropSession,
|
||||
defaultStorageAdapters,
|
||||
loginWithNip01,
|
||||
loginWithNip46,
|
||||
EventsStorageAdapter,
|
||||
@@ -85,7 +83,7 @@
|
||||
import * as net from "@welshman/net"
|
||||
import * as app from "@welshman/app"
|
||||
import {nsecDecode} from "@lib/util"
|
||||
import {preferencesStorageProvider} from "@lib/storage"
|
||||
import {defaultStorageProviders, initFileStorage, preferencesStorageProvider} from "@lib/storage"
|
||||
import AppContainer from "@app/components/AppContainer.svelte"
|
||||
import ModalContainer from "@app/components/ModalContainer.svelte"
|
||||
import {setupTracking} from "@app/util/tracking"
|
||||
@@ -111,6 +109,7 @@
|
||||
import * as appState from "@app/core/state"
|
||||
import {badgeCount, handleBadgeCountChanges} from "@app/util/notifications"
|
||||
import NewNotificationSound from "@src/app/components/NewNotificationSound.svelte"
|
||||
import {EventsStorageProvider} from "@lib/storage/events"
|
||||
|
||||
// Migration: old nostrtalk instance used different sessions
|
||||
if ($session && !$signer) {
|
||||
@@ -280,10 +279,8 @@
|
||||
storage: preferencesStorageProvider,
|
||||
})
|
||||
|
||||
await initStorage("flotilla", 8, {
|
||||
...defaultStorageAdapters,
|
||||
events: new EventsStorageAdapter({
|
||||
name: "events",
|
||||
await initFileStorage({...defaultStorageProviders,
|
||||
events: new EventsStorageProvider({
|
||||
limit: 10_000,
|
||||
repository,
|
||||
rankEvent: (e: TrustedEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user