Skip to content

Commit

Permalink
Updated UI kit version to 4.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
swayam-cometchat committed Sep 25, 2024
1 parent f3ba0d6 commit 73384f2
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 75 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cometchat-chat-sample-app-vue",
"version": "4.3.7",
"version": "4.3.9",
"license": "https://www.cometchat.com/legal-terms-of-service",
"private": true,
"scripts": {
Expand All @@ -9,8 +9,8 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@cometchat/chat-uikit-vue": "^4.3.7",
"@cometchat/calls-sdk-javascript": "^4.0.7",
"@cometchat/chat-uikit-vue": "^4.3.17",
"@cometchat/calls-sdk-javascript": "^4.0.10",
"core-js": "^3.8.3",
"file-loader": "^6.2.0",
"vue": "^3.2.13"
Expand Down
2 changes: 1 addition & 1 deletion src/metaInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const metaInfo = {
name: "cometchat-chat-sample-app-vue",
version: "4.3.8",
version: "4.3.9",
type: "sample",
platform: "Vue",
};
14 changes: 12 additions & 2 deletions src/views/CallButtonsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,20 @@ export default defineComponent({
}
: {};
});
let user: any = ref(null);
let user: any = ref<CometChat.User>();
onBeforeMount(async () => {
user.value = await CometChat.getUser("superhero2");
try {
const usersRequest = new CometChat.UsersRequestBuilder()
.setLimit(1)
.build();
const fetchedUsers = await usersRequest.fetchNext();
if (fetchedUsers && fetchedUsers.length > 0) {
user.value = fetchedUsers[0];
}
} catch (error) {
console.error("Error fetching users:", error);
}
});
const getCallButtonStyle = () => {
Expand Down
6 changes: 0 additions & 6 deletions src/views/CreateJoinGroupView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,9 @@ export default defineComponent({
}
: {};
});
let user: any = ref(null);
onBeforeMount(async () => {
user.value = await CometChat.getUser("superhero2");
});
return {
computedStyles,
user,
route,
};
},
Expand Down
29 changes: 25 additions & 4 deletions src/views/DetailsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,38 @@ export default defineComponent({
},
},
setup() {
let group: any = ref(null);
let user: any = ref(null);
const group = ref<CometChat.Group>();
const user = ref<CometChat.User>();
const route: any = useRoute();
onBeforeMount(async () => {
if (route.name == "groupsdetails") {
group.value = await CometChat.getGroup("supergroup");
try {
const groupsRequest = new CometChat.GroupsRequestBuilder()
.setLimit(1)
.joinedOnly(true)
.build();
const fetchedGroups = await groupsRequest.fetchNext();
if (fetchedGroups && fetchedGroups.length > 0) {
group.value = fetchedGroups[0];
}
} catch (error) {
console.error("Error fetching groups:", error);
}
}
if (route.name == "usersdetails") {
user.value = await CometChat.getUser("superhero2");
try {
const usersRequest = new CometChat.UsersRequestBuilder()
.setLimit(1)
.build();
const fetchedUsers = await usersRequest.fetchNext();
if (fetchedUsers && fetchedUsers.length > 0) {
user.value = fetchedUsers[0];
}
} catch (error) {
console.error("Error fetching users:", error);
}
}
});
Expand Down
16 changes: 14 additions & 2 deletions src/views/GroupsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
:group="group"
></CometChatAddMembers>
<CometChatGroupsWithMessages
v-if="route.name == 'groupswithmessages'"
:isMobileView="isMobileView"
></CometChatGroupsWithMessages>
</template>
Expand Down Expand Up @@ -44,9 +45,20 @@ export default defineComponent({
setup() {
let { isMobileView }: any = inject("isMobileView");
const route: any = useRoute();
let group: any = ref(null);
const group = ref<CometChat.Group>();
onBeforeMount(async () => {
group.value = await CometChat.getGroup("supergroup");
try {
const groupsRequest = new CometChat.GroupsRequestBuilder()
.setLimit(1)
.joinedOnly(true)
.build();
const fetchedGroups = await groupsRequest.fetchNext();
if (fetchedGroups && fetchedGroups.length > 0) {
group.value = fetchedGroups[0];
}
} catch (error) {
console.error("Error fetching groups:", error);
}
});
return { group, route, isMobileView };
Expand Down
44 changes: 14 additions & 30 deletions src/views/MessageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,40 +51,24 @@ export default defineComponent({
setup() {
const router = useRouter();
const route: any = useRoute();
let currentGroup = ref();
let currentUser = ref();
let users = ref();
let currentGroup = ref<CometChat.Group>();
var GUID = "supergroup";
CometChat.getGroup(GUID).then(
(group) => {
currentGroup.value = group;
},
(error) => {
console.log("Group details fetching failed with exception:", error);
}
);
var limit = 30;
var usersRequest = new CometChat.UsersRequestBuilder()
.setLimit(limit)
.build();
usersRequest.fetchNext().then(
(userList) => {
users.value = userList;
currentUser.value = userList[0];
},
(error) => {
console.log("User list fetching failed with error:", error);
}
);
onBeforeMount(async () => {
currentUser.value = await CometChat.getUser("superhero2");
currentGroup.value = await CometChat.getGroup("supergroup");
try {
const groupsRequest = new CometChat.GroupsRequestBuilder()
.setLimit(1)
.joinedOnly(true)
.build();
const fetchedGroups = await groupsRequest.fetchNext();
if (fetchedGroups && fetchedGroups.length > 0) {
currentGroup.value = fetchedGroups[0];
}
} catch (error) {
console.error("Error fetching groups:", error);
}
});
return { router, route, currentGroup, users, currentUser };
return { router, route, currentGroup };
},
});
</script>
Expand Down
20 changes: 17 additions & 3 deletions src/views/TransferOwnershipView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<CometChatTransferOwnership :group="group"></CometChatTransferOwnership>
<CometChatTransferOwnership
v-if="group"
:group="group"
></CometChatTransferOwnership>
</template>
<script lang="ts">
import { defineComponent, onBeforeMount, ref } from "vue";
Expand All @@ -17,9 +20,20 @@ export default defineComponent({
},
},
setup() {
let group: any = ref(null);
const group = ref<CometChat.Group>();
onBeforeMount(async () => {
group.value = await CometChat.getGroup("supergroup");
try {
const groupsRequest = new CometChat.GroupsRequestBuilder()
.setLimit(1)
.joinedOnly(true)
.build();
const fetchedGroups = await groupsRequest.fetchNext();
if (fetchedGroups && fetchedGroups.length > 0) {
group.value = fetchedGroups[0];
}
} catch (error) {
console.error("Error fetching groups:", error);
}
});
return { group };
Expand Down
26 changes: 2 additions & 24 deletions src/views/UsersView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="user-view__wrapper">
<div v-if="route.name == 'CometChatUsers'" class="cc__users">
<div class="cc__users-child">
<CometChatUsers :list="users"></CometChatUsers>
<CometChatUsers></CometChatUsers>
</div>
</div>
<div
Expand Down Expand Up @@ -38,29 +38,7 @@ export default defineComponent({
const router = useRouter();
const route: any = useRoute();
let { isMobileView }: any = inject("isMobileView");
let currentUser = ref();
let users = ref();
var limit = 30;
var usersRequest = new CometChat.UsersRequestBuilder()
.setLimit(limit)
.build();
usersRequest.fetchNext().then(
(userList) => {
users.value = userList;
currentUser.value = userList[0];
},
(error) => {
console.log("User list fetching failed with error:", error);
}
);
onBeforeMount(async () => {
currentUser.value = await CometChat.getUser("superhero2");
});
return { router, route, users, currentUser, isMobileView };
return { router, route, isMobileView };
},
});
</script>
Expand Down

0 comments on commit 73384f2

Please sign in to comment.