diff --git a/app/client/web/src/identity/Identity.tsx b/app/client/web/src/identity/Identity.tsx index d972ed74..ce69c34b 100644 --- a/app/client/web/src/identity/Identity.tsx +++ b/app/client/web/src/identity/Identity.tsx @@ -9,19 +9,15 @@ import { } from '@tabler/icons-react' import { modals } from '@mantine/modals'; -export function Identity({ settings, contacts }) { +export function Identity({ settings, contacts }: { settings: () => void, contacts: () => void }) { const { state, actions } = useIdentity(); const [all, setAll] = useState(false); - const click = (ev) => { - console.log("CLICK", ev.currentTarget.checked); - } - const logout = () => modals.openConfirmModal({ title: state.strings.confirmLogout, withCloseButton: false, children: ( - actions.setAll(ev.currentTarget.checked)} /> + actions.setAll(ev.currentTarget.checked)} /> ), labels: { confirm: state.strings.logout, cancel: state.strings.cancel }, onConfirm: actions.logout, diff --git a/app/client/web/src/identity/useIdentity.hook.ts b/app/client/web/src/identity/useIdentity.hook.ts index 52fd0629..1dccb24c 100644 --- a/app/client/web/src/identity/useIdentity.hook.ts +++ b/app/client/web/src/identity/useIdentity.hook.ts @@ -17,7 +17,7 @@ export function useIdentity() { } const actions = { - setAll: (all) => { + setAll: (all: boolean) => { updateState({ all }); }, logout: async () => { diff --git a/app/client/web/src/settings/useSettings.hook.ts b/app/client/web/src/settings/useSettings.hook.ts index 75fc3ad3..564544ba 100644 --- a/app/client/web/src/settings/useSettings.hook.ts +++ b/app/client/web/src/settings/useSettings.hook.ts @@ -34,6 +34,7 @@ export function useSettings() { } settings.addConfigListener(setConfig); const setProfile = (profile: Profile) => { +console.log("URL: ", identity.getProfileImageUrl()); updateState({ profile }) } identity.addProfileListener(setProfile) diff --git a/app/sdk/src/identity.ts b/app/sdk/src/identity.ts index 1f88fcd9..dcf73804 100644 --- a/app/sdk/src/identity.ts +++ b/app/sdk/src/identity.ts @@ -65,7 +65,7 @@ export class IdentityModule implements Identity { await this.store.setProfileData(guid, profile); await this.store.setProfileRevision(guid, nextRev); this.profile = profile; - this.emitter.emit('profile', this.getProfile()); + this.emitter.emit('profile', this.setProfile()); this.revision = nextRev; if (this.nextRevision === nextRev) { this.nextRevision = null; @@ -82,14 +82,14 @@ export class IdentityModule implements Identity { } } - public getProfile() { + public setProfile() { const { guid, handle, name, description, location, image, revision, seal, version, node } = this.profile; - return { guid, handle, name, description, location, image, version, node, sealSet: Boolean(seal) }; + return { guid, handle, name, description, location, imageSet: Boolean(image), version, node, sealSet: Boolean(seal) }; } public addProfileListener(ev: (profile: Profile) => void): void { this.emitter.on('profile', ev); - this.emitter.emit('profile', this.getProfile()); + this.emitter.emit('profile', this.setProfile()); } public removeProfileListener(ev: (profile: Profile) => void): void { diff --git a/app/sdk/src/types.ts b/app/sdk/src/types.ts index beeb1ef0..11cb7940 100644 --- a/app/sdk/src/types.ts +++ b/app/sdk/src/types.ts @@ -157,7 +157,7 @@ export type Profile = { name: string, description: string, location: string, - image: string, + imageSet: boolean, sealSet: boolean, version: string, node: string,