Skip to content

GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.

chore: bump app version to v6.1.1 and refactor admin check logic

Aldino Kemal2f438c799c1e
diff --git a/src/config/settings.go b/src/config/settings.go
index 50252e33..3da9376b 100644
--- a/src/config/settings.go
+++ b/src/config/settings.go
@@ -5,7 +5,7 @@ import (
)
var (
- AppVersion = "v6.1.0"
+ AppVersion = "v6.1.1"
AppPort = "3000"
AppDebug = false
AppOs = "AldinoKemal"
diff --git a/src/views/components/GroupList.js b/src/views/components/GroupList.js
index 3fe44c24..5cb99694 100644
--- a/src/views/components/GroupList.js
+++ b/src/views/components/GroupList.js
@@ -80,9 +80,17 @@ export default {
if (!value) return ''
return moment(value).format('LLL');
},
- isAdmin(ownerJID) {
- const owner = ownerJID.split('@')[0];
- return owner === this.currentUserId;
+ isAdmin(group) {
+ // Check if current user is the owner
+ const owner = group.OwnerJID.split('@')[0];
+ if (owner === this.currentUserId) {
+ return true;
+ }
+
+ // Check if current user is an admin in participants
+ const currentUserJID = `${this.currentUserId}@s.whatsapp.net`;
+ const participant = group.Participants.find(p => p.JID === currentUserJID);
+ return participant && participant.IsAdmin;
},
async handleSeeRequestedMember(group_id) {
this.selectedGroupId = group_id;
@@ -180,7 +188,7 @@ export default {
<td>{{ formatDate(g.GroupCreated) }}</td>
<td>
<div style="display: flex; gap: 8px; align-items: center;">
- <button v-if="isAdmin(g.OwnerJID)" class="ui green tiny button" @click="handleSeeRequestedMember(g.JID)">Requested Members</button>
+ <button v-if="isAdmin(g)" class="ui green tiny button" @click="handleSeeRequestedMember(g.JID)">Requested Members</button>
<button class="ui red tiny button" @click="handleLeaveGroup(g.JID)">Leave</button>
</div>
</td>