From 42823c0e9474d0466680d37ea6a4d9dfb215a938 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Thu, 7 Aug 2025 06:21:52 +0200 Subject: [PATCH 1/6] fix: missing type property for Reset context menu item in ResizableSidebar --- components/UserInterface/ResizableSidebar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/UserInterface/ResizableSidebar.vue b/components/UserInterface/ResizableSidebar.vue index 27b0730..79e95bd 100644 --- a/components/UserInterface/ResizableSidebar.vue +++ b/components/UserInterface/ResizableSidebar.vue @@ -34,7 +34,7 @@ const storedWidth = ref(); const contextMenu = useState("contextMenu"); const menuItems: ContextMenuItem[] = [ - { name: "Reset", callback: () => { + { name: "Reset", type: "normal", callback: () => { const defaultWidth = props.width ?? props.minWidth; resizableSidebar.value!.style.width = defaultWidth; if (props.localStorageName) { From 4dbe548efc07110be3329f9658e0edc5010d3e66 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Thu, 7 Aug 2025 06:31:15 +0200 Subject: [PATCH 2/6] feat: create enums.ts file and add Permission enum --- types/enums.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 types/enums.ts diff --git a/types/enums.ts b/types/enums.ts new file mode 100644 index 0000000..ac2daba --- /dev/null +++ b/types/enums.ts @@ -0,0 +1,11 @@ +export const enum Permission { + SendMessage = 1, + ManageChannel = 2, + ManageRole = 4, + CreateInvite = 8, + ManageInvite = 16, + ManageGuild = 32, + ManageMember = 64, + BanMember = 128, + KickMember = 256 +} \ No newline at end of file From 695bdbc77784474ca9d51b399716f6324a423159 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Thu, 7 Aug 2025 06:31:44 +0200 Subject: [PATCH 3/6] feat: update GuildResponse and GuildMemberResponse interfaces to match backend --- types/interfaces.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/interfaces.ts b/types/interfaces.ts index 2a05c38..632aadb 100644 --- a/types/interfaces.ts +++ b/types/interfaces.ts @@ -19,16 +19,17 @@ export interface GuildResponse { description: string | null, icon: string | null, owner_uuid: string, - roles: [], + roles: RoleResponse[], member_count: number } export interface GuildMemberResponse { uuid: string, nickname: string, - user_uuid: string, guild_uuid: string, - user: UserResponse + is_owner: boolean, + user: UserResponse, + roles: RoleResponse[] } export interface ChannelResponse { From aecbcaefba4dfb4b5532ddb714c11f7e0eeece65 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Thu, 7 Aug 2025 06:32:04 +0200 Subject: [PATCH 4/6] feat: add hasPermission util to check if a member has a specific permission --- utils/hasPermission.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 utils/hasPermission.ts diff --git a/utils/hasPermission.ts b/utils/hasPermission.ts new file mode 100644 index 0000000..750716e --- /dev/null +++ b/utils/hasPermission.ts @@ -0,0 +1,11 @@ +import type { Permission } from "~/types/enums"; +import type { GuildMemberResponse } from "~/types/interfaces"; + +export default (member: GuildMemberResponse, permission: Permission) => { + for (const role of member.roles) { + if (role.permissions & permission) { + return true; + } + } + return false; +} From 76f77f7bfed610f00d79d26c30de72c3e59f891e Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Thu, 7 Aug 2025 09:07:46 +0200 Subject: [PATCH 5/6] fix: invite link generation not accounting for baseURL --- components/Modal/Invite.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/Modal/Invite.vue b/components/Modal/Invite.vue index 232114c..de842a2 100644 --- a/components/Modal/Invite.vue +++ b/components/Modal/Invite.vue @@ -40,7 +40,8 @@ function copyInvite(type: "link" | "code") { if (!invite.value) return; if (type == "link") { - const inviteUrl = URL.parse(`invite/${invite.value}`, `${window.location.protocol}//${window.location.host}`); + const runtimeConfig = useRuntimeConfig(); + const inviteUrl = URL.parse(`invite/${invite.value}`, `${window.location.protocol}//${window.location.host}${runtimeConfig.app.baseURL}`); if (inviteUrl) { navigator.clipboard.writeText(inviteUrl.href); } From 395dd6cf9b0957f7a37b703573b3f0b2a649a9e5 Mon Sep 17 00:00:00 2001 From: Temmie Date: Sat, 9 Aug 2025 12:42:33 +0200 Subject: [PATCH 6/6] fix: layout preview not working with a non-default baseurl --- components/Settings/AppSettings/Appearance.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/Settings/AppSettings/Appearance.vue b/components/Settings/AppSettings/Appearance.vue index 98c41f9..f6f40f4 100644 --- a/components/Settings/AppSettings/Appearance.vue +++ b/components/Settings/AppSettings/Appearance.vue @@ -34,7 +34,8 @@ {{ layout.displayName }} - + + @@ -60,8 +61,8 @@ import { settingSave, settingsLoad } from '#imports'; const runtimeConfig = useRuntimeConfig() const baseURL = runtimeConfig.app.baseURL; -const styleFolder = `${baseURL}themes/style` -const layoutFolder = `${baseURL}themes/layout` +const styleFolder = `${baseURL}/themes/style` +const layoutFolder = `${baseURL}/themes/layout` const timeFormatTextStrings = ["Auto", "12-Hour", "24-Hour"] @@ -115,6 +116,7 @@ async function parseTheme(url: string): Promise { break case "previewImageUrl": previewImageUrl = `${layoutFolder}/${lineArray[1].trim()}` + console.log(previewImageUrl) break } }