@@ -183,7 +184,7 @@
@@ -241,8 +242,8 @@
diff --git a/ui/src/components/ButtonFollow.vue b/ui/src/components/ButtonFollow.vue
index 33ac1695..5375d646 100644
--- a/ui/src/components/ButtonFollow.vue
+++ b/ui/src/components/ButtonFollow.vue
@@ -121,8 +121,8 @@ const showSuccessMessage = async () => {
const profile = await profilesStore.client.getAgentProfile(
props.agentPubKey
);
- name = `${profile?.fields[PROFILE_FIELDS.DISPLAY_NAME]} (@${
- profile?.nickname
+ name = `${profile?.entry.fields[PROFILE_FIELDS.DISPLAY_NAME]} (@${
+ profile?.entry.nickname
})`;
} catch (error) {
console.error(error);
diff --git a/ui/src/components/CreateProfileIfNotFoundDialog.vue b/ui/src/components/CreateProfileIfNotFoundDialog.vue
index 240dc05a..d27c7f60 100644
--- a/ui/src/components/CreateProfileIfNotFoundDialog.vue
+++ b/ui/src/components/CreateProfileIfNotFoundDialog.vue
@@ -39,7 +39,6 @@ const baseEditAgentProfileFormRef = ref();
const createProfile = async (profile: Profile) => {
await profilesStore.client.createProfile(profile);
- await profilesStore.myProfile.reload();
emit("profile-created", profile);
emit("update:model-value", false);
diff --git a/ui/src/components/CreatorsListDialog.vue b/ui/src/components/CreatorsListDialog.vue
index e8294aaa..9a4fa5c0 100644
--- a/ui/src/components/CreatorsListDialog.vue
+++ b/ui/src/components/CreatorsListDialog.vue
@@ -91,7 +91,7 @@ const fetchCreators = async (params: any) => {
return {
agentPubKey,
- profile,
+ profile: profile?.entry
} as AgentProfile;
})
);
diff --git a/ui/src/components/EditAgentProfileDialog.vue b/ui/src/components/EditAgentProfileDialog.vue
index 79c60ba1..70ccf095 100644
--- a/ui/src/components/EditAgentProfileDialog.vue
+++ b/ui/src/components/EditAgentProfileDialog.vue
@@ -42,7 +42,6 @@ const baseEditAgentProfileFormRef = ref();
const update = async (newProfile: Profile) => {
try {
await profilesStore.client.updateProfile(newProfile);
- await profilesStore.myProfile.reload();
emit("update:model-value", false);
emit("profile-updated", newProfile);
diff --git a/ui/src/components/FollowersListDialog.vue b/ui/src/components/FollowersListDialog.vue
index f84f09e1..cd63891e 100644
--- a/ui/src/components/FollowersListDialog.vue
+++ b/ui/src/components/FollowersListDialog.vue
@@ -91,7 +91,7 @@ const fetchFollowers = async (params: any) => {
return {
agentPubKey,
- profile,
+ profile: profile?.entry,
} as AgentProfile;
})
);
diff --git a/ui/src/components/NetworkInfo.vue b/ui/src/components/NetworkInfo.vue
index 130ad988..026b5e30 100644
--- a/ui/src/components/NetworkInfo.vue
+++ b/ui/src/components/NetworkInfo.vue
@@ -35,7 +35,7 @@
Completed Rounds Since Last Queried
{{ data[0]?.completed_rounds_since_last_time_queried }}
-
+
{
const profile = await profilesStore.client.getAgentProfile(agentPubKey.value);
- if (profile) {
- return profile;
+ if (profile?.entry) {
+ return profile.entry;
} else {
throw new Error("No profile found");
}
diff --git a/ui/src/pages/MewYarn.vue b/ui/src/pages/MewYarn.vue
index 70d9c1a4..2c0bea3e 100644
--- a/ui/src/pages/MewYarn.vue
+++ b/ui/src/pages/MewYarn.vue
@@ -113,7 +113,7 @@ const fetchReplies = (params: any) =>
original_mew_hash: mew?.value.action_hash,
page: {
limit: pageLimit,
- direction: { [PaginationDirectionName.Ascending]: null },
+ direction: PaginationDirectionName.Ascending,
...params.pageParam,
},
},
diff --git a/ui/src/pages/MewsFeed.vue b/ui/src/pages/MewsFeed.vue
index ca70c5a7..83cd65cf 100644
--- a/ui/src/pages/MewsFeed.vue
+++ b/ui/src/pages/MewsFeed.vue
@@ -79,7 +79,7 @@ const fetchMewsFeed = (params: any): Promise =>
agent: client.myPubKey,
page: {
limit: pageLimit,
- direction: { [PaginationDirectionName.Descending]: null },
+ direction: PaginationDirectionName.Descending,
...params.pageParam,
},
},
diff --git a/ui/src/pages/MewsListAuthor.vue b/ui/src/pages/MewsListAuthor.vue
index 62bbcf22..95f24db9 100644
--- a/ui/src/pages/MewsListAuthor.vue
+++ b/ui/src/pages/MewsListAuthor.vue
@@ -125,8 +125,8 @@ const { data, error, fetchNextPage, hasNextPage, isInitialLoading, refetch } =
const fetchProfile = async () => {
const profile = await profilesStore.client.getAgentProfile(agentPubKey.value);
- if (profile) {
- return profile;
+ if (profile?.entry) {
+ return profile.entry;
} else {
throw new Error("No profile found");
}
diff --git a/ui/src/pages/MyNotifications.vue b/ui/src/pages/MyNotifications.vue
index 6fd0a4b8..436c0713 100644
--- a/ui/src/pages/MyNotifications.vue
+++ b/ui/src/pages/MyNotifications.vue
@@ -81,7 +81,7 @@ const fetchNotifications = async (params: any) => {
agent: client.myPubKey,
page: {
limit: pageLimit,
- direction: { [PaginationDirectionName.Descending]: null },
+ direction: PaginationDirectionName.Descending,
...params.pageParam,
},
},
diff --git a/ui/src/types/types.ts b/ui/src/types/types.ts
index 6702d419..75b389e1 100644
--- a/ui/src/types/types.ts
+++ b/ui/src/types/types.ts
@@ -185,15 +185,15 @@ export enum NotificationTypeName {
}
export type NotificationType =
- | { [NotificationTypeName.MyMewLicked]: null }
- | { [NotificationTypeName.MyMewUnlicked]: null }
- | { [NotificationTypeName.MyMewPinned]: null }
- | { [NotificationTypeName.MyMewUnpinned]: null }
- | { [NotificationTypeName.MyMewResponded]: null }
- | { [NotificationTypeName.MyAgentMentioned]: null }
- | { [NotificationTypeName.MyAgentFollowed]: null }
- | { [NotificationTypeName.MyAgentUnfollowed]: null }
- | { [NotificationTypeName.FollowedYarnResponded]: null };
+ | NotificationTypeName.MyMewLicked
+ | NotificationTypeName.MyMewUnlicked
+ | NotificationTypeName.MyMewPinned
+ | NotificationTypeName.MyMewUnpinned
+ | NotificationTypeName.MyMewResponded
+ | NotificationTypeName.MyAgentMentioned
+ | NotificationTypeName.MyAgentFollowed
+ | NotificationTypeName.MyAgentUnfollowed
+ | NotificationTypeName.FollowedYarnResponded;
export declare type CacheData = {
data: R;
@@ -214,8 +214,8 @@ export type TimestampPagination = {
};
export type PaginationDirectionType =
- | { [PaginationDirectionName.Ascending]: null }
- | { [PaginationDirectionName.Descending]: null };
+ | PaginationDirectionName.Ascending
+ | PaginationDirectionName.Descending;
export enum PaginationDirectionName {
Ascending = "Ascending",
diff --git a/ui/src/utils/client.ts b/ui/src/utils/client.ts
index fc444218..c4bfe413 100644
--- a/ui/src/utils/client.ts
+++ b/ui/src/utils/client.ts
@@ -2,21 +2,18 @@ import { AdminWebsocket, CellType, AppWebsocket } from "@holochain/client";
import WebSdkApi, { AgentState } from "@holo-host/web-sdk";
export const HOLOCHAIN_APP_ID = "mewsfeed";
-export const IS_LAUNCHER = import.meta.env.VITE_IS_LAUNCHER;
+export const IS_LAUNCHER = (window as any).__HC_LAUNCHER_ENV__ !== undefined;
export const IS_HOLO_HOSTED = import.meta.env.VITE_IS_HOLO_HOSTED;
export const setupHolochain = async () => {
try {
let client;
- if (typeof window === "object" && !("__HC_LAUNCHER_ENV__" in window)) {
- client = await createClient();
- } else {
+ if (IS_LAUNCHER) {
client = await AppWebsocket.connect({
- url: IS_LAUNCHER
- ? new URL(`ws://UNUSED`)
- : new URL(`ws://localhost:${import.meta.env.VITE_HC_PORT}`),
defaultTimeout: 60000,
});
+ } else {
+ client = await createClient();
}
return client;
diff --git a/ui/src/utils/profiles.ts b/ui/src/utils/profiles.ts
index 2c419574..6d3c4c3b 100644
--- a/ui/src/utils/profiles.ts
+++ b/ui/src/utils/profiles.ts
@@ -38,7 +38,8 @@ export const useSearchProfiles = () => {
new Promise((resolve, reject) => {
profilesStore.searchProfiles(input).subscribe((res) => {
if (res.status === "complete") {
- resolve(Array.from(res.value.entries()));
+ const entries: [Uint8Array, Profile][] = Array.from(res.value).map(([a, b]) => [a, b.entry]);
+ resolve(entries);
} else if (res.status === "error") reject(res);
});
});
diff --git a/ui/vite.config.ts b/ui/vite.config.ts
index bee3a7c1..eb08c9b9 100644
--- a/ui/vite.config.ts
+++ b/ui/vite.config.ts
@@ -10,7 +10,16 @@ import IconsResolver from "unplugin-icons/resolver";
export default defineConfig({
server: {
- open: true,
+ port: 1420,
+ strictPort: true,
+ host: process.env.TAURI_DEV_HOST || false,
+ hmr: process.env.TAURI_DEV_HOST
+ ? {
+ protocol: "ws",
+ host: process.env.TAURI_DEV_HOST,
+ port: 1430,
+ }
+ : undefined,
},
resolve: {
alias: {