Skip to content

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Leblow committed Dec 6, 2023
1 parent 0b1a250 commit 7e44084
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('CommmunityMetadataStore', () => {
describe('updateCommunityMetadata', () => {
test('updates community metadata if the metadata is valid', async () => {
const ret = await store.updateCommunityMetadata(metaValid)
const meta = await store.getCommunityMetadata()
const meta = store.getCommunityMetadata()

expect(ret).toStrictEqual(metaValidWithOwnerId)
expect(meta).toStrictEqual(metaValidWithOwnerId)
Expand All @@ -89,7 +89,7 @@ describe('CommmunityMetadataStore', () => {
rootCa: 'Something invalid!',
}
const ret = await store.updateCommunityMetadata(metaInvalid)
const meta = await store.getCommunityMetadata()
const meta = store.getCommunityMetadata()

expect(ret).toStrictEqual(undefined)
expect(meta).toEqual(undefined)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class CommunityMetadataStore {
// @ts-expect-error - OrbitDB's type declaration of `load` lacks 'options'
// TODO: Is this necessary here?
await this.store.load({ fetchEntryTimeout: 15000 })
const meta = await this.getCommunityMetadata()
const meta = this.getCommunityMetadata()
if (meta) {
emitter.emit(StorageEvents.COMMUNITY_METADATA_SAVED, meta)
}
Expand All @@ -87,7 +87,7 @@ export class CommunityMetadataStore {
// @ts-expect-error - OrbitDB's type declaration of `load` lacks 'options'
await this.store.load({ fetchEntryTimeout: 15000 })
logger('Loaded community metadata to memory')
const meta = await this.getCommunityMetadata()
const meta = this.getCommunityMetadata()
if (meta) {
emitter.emit(StorageEvents.COMMUNITY_METADATA_SAVED, meta)
}
Expand Down Expand Up @@ -209,7 +209,7 @@ export class CommunityMetadataStore {
}
}

public getCommunityMetadata(): Promise<CommunityMetadata | undefined> {
public getCommunityMetadata(): CommunityMetadata | undefined {
const metadata = Object.values(this.store.all)

if (metadata.length > 0) {
Expand Down

0 comments on commit 7e44084

Please sign in to comment.