mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-07 16:23:09 +00:00
refactor: rename storageKey to storageKeyPrefix and update storage key generation.
This commit is contained in:
parent
16587fab25
commit
b24eb86d37
@ -12,7 +12,7 @@ export interface HistoryStorage {
|
|||||||
export interface PersistentHistoryOptions {
|
export interface PersistentHistoryOptions {
|
||||||
channelId: ChannelId;
|
channelId: ChannelId;
|
||||||
storage?: HistoryStorage;
|
storage?: HistoryStorage;
|
||||||
storageKey?: string;
|
storageKeyPrefix?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type StoredHistoryEntry = {
|
type StoredHistoryEntry = {
|
||||||
@ -46,8 +46,7 @@ export class PersistentHistory implements ILocalHistory {
|
|||||||
public constructor(options: PersistentHistoryOptions) {
|
public constructor(options: PersistentHistoryOptions) {
|
||||||
this.memory = new MemLocalHistory();
|
this.memory = new MemLocalHistory();
|
||||||
this.storage = options.storage ?? getDefaultHistoryStorage();
|
this.storage = options.storage ?? getDefaultHistoryStorage();
|
||||||
this.storageKey =
|
this.storageKey = `${HISTORY_STORAGE_PREFIX}${options.storageKeyPrefix}:${options.channelId}`;
|
||||||
options.storageKey ?? `${HISTORY_STORAGE_PREFIX}${options.channelId}`;
|
|
||||||
this.restore();
|
this.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user