diff --git a/.woodpecker/build-and-publish.yml b/.woodpecker/build-and-publish.yml index 6001a00..e62bd74 100644 --- a/.woodpecker/build-and-publish.yml +++ b/.woodpecker/build-and-publish.yml @@ -8,7 +8,6 @@ steps: - pnpm build when: - event: push - - event: pull_request - name: container-build-and-publish image: docker diff --git a/app.vue b/app.vue index 3a1c491..8ca7948 100644 --- a/app.vue +++ b/app.vue @@ -1,7 +1,7 @@ @@ -55,7 +55,10 @@ function contextMenuHandler(e: MouseEvent) { diff --git a/components/Me/AddFriend.vue b/components/Me/AddFriend.vue index 43249fb..6d2d888 100644 --- a/components/Me/AddFriend.vue +++ b/components/Me/AddFriend.vue @@ -23,11 +23,9 @@ async function sendRequest() { try { await addFriend(inputField.value.value) alert("Friend request sent!") - } catch (error: any) { - if (error?.response?.status !== 200) { - alert(`error ${error?.response?.status} met whilst trying to add friend\n"${error?.response._data?.message}"`) - } - } + } catch { + alert("Request failed :(") + } } } diff --git a/components/Me/FriendsList.vue b/components/Me/FriendsList.vue index 25b9924..0a1481e 100644 --- a/components/Me/FriendsList.vue +++ b/components/Me/FriendsList.vue @@ -24,8 +24,6 @@ @@ -49,12 +42,9 @@ function onCloseButton () { flex-direction: column; gap: 1em; opacity: 100%; - - padding: var(--standard-radius); - border-radius: var(--standard-radius); - background-color: var(--chat-highlighted-background-color); + padding: 1%; + background-color: var(--sidebar-highlighted-background-color); color: var(--text-color); - overflow: hidden; } diff --git a/components/Modal/ProfilePopup.vue b/components/Modal/ProfilePopup.vue deleted file mode 100644 index 07181be..0000000 --- a/components/Modal/ProfilePopup.vue +++ /dev/null @@ -1,243 +0,0 @@ - - - - - \ No newline at end of file diff --git a/components/Popups/CropPopup.vue b/components/Popups/CropPopup.vue index 12c3a0b..3a9586c 100644 --- a/components/Popups/CropPopup.vue +++ b/components/Popups/CropPopup.vue @@ -10,6 +10,7 @@ @@ -22,12 +21,11 @@ const props = defineProps<{ background-color: var(--primary-color); color: var(--text-color); - padding: 0.35em 0.65em; - font-size: 1em; - + padding: 0.4em 0.75em; + font-size: 1.1em; transition: background-color 0.2s; - border-radius: var(--standard-radius); + border-radius: 0.7rem; text-decoration: none; display: inline-block; @@ -52,11 +50,4 @@ const props = defineProps<{ background-color: var(--accent-highlighted-color); } -.stealth-button { - background-color: unset; -} -.stealth-button:hover { - background-color: unset; -} - \ No newline at end of file diff --git a/components/UserInterface/HorizontalSpacer.vue b/components/UserInterface/HorizontalSpacer.vue deleted file mode 100644 index cc95c92..0000000 --- a/components/UserInterface/HorizontalSpacer.vue +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/components/UserInterface/VerticalSpacer.vue b/components/UserInterface/VerticalSpacer.vue index 9f0e304..8ac1bd6 100644 --- a/components/UserInterface/VerticalSpacer.vue +++ b/components/UserInterface/VerticalSpacer.vue @@ -1,11 +1,11 @@ \ No newline at end of file diff --git a/types/interfaces.ts b/types/interfaces.ts index 6fd9c96..2a05c38 100644 --- a/types/interfaces.ts +++ b/types/interfaces.ts @@ -96,8 +96,7 @@ export interface ModalProps { title?: string, obscure?: boolean, onClose?: () => void, - onCancel?: () => void, - onCloseButton?: () => void, + onCancel?: () => void } export interface ContextMenuItem { diff --git a/utils/editMessage.ts b/utils/editMessage.ts index d8ad005..5cc3ce8 100644 --- a/utils/editMessage.ts +++ b/utils/editMessage.ts @@ -1,12 +1,9 @@ import type { MessageProps } from "~/types/props"; -const { fetchMe } = useApi() - export default async (element: HTMLDivElement, props: MessageProps) => { console.log("message:", element); - const me = await fetchMe(); - - if (me && props.author?.uuid == me.uuid) { + const me = await fetchWithApi("/me") as any; + if (props.author?.uuid == me.uuid) { const text = element.getElementsByClassName("message-text")[0] as HTMLDivElement; text.contentEditable = "true"; text.focus(); diff --git a/utils/getDisplayName.ts b/utils/getDisplayName.ts new file mode 100644 index 0000000..015edbc --- /dev/null +++ b/utils/getDisplayName.ts @@ -0,0 +1,7 @@ +import type { GuildMemberResponse, UserResponse } from "~/types/interfaces"; + +export default (user: UserResponse, member?: GuildMemberResponse): string => { + if (member?.nickname) return member.nickname + if (user.display_name) return user.display_name + return user.username +} \ No newline at end of file diff --git a/utils/sortMembers.ts b/utils/sortMembers.ts index b232763..87a1a2a 100644 --- a/utils/sortMembers.ts +++ b/utils/sortMembers.ts @@ -1,8 +1,7 @@ import type { GuildMemberResponse } from "~/types/interfaces"; -const { getDisplayName } = useProfile() export default (members: GuildMemberResponse[]): GuildMemberResponse[] => { return members.sort((a, b) => { - return getDisplayName(a).localeCompare(getDisplayName(b)) + return getDisplayName(a.user, a).localeCompare(getDisplayName(b.user, b)) }) } \ No newline at end of file diff --git a/utils/sortUsers.ts b/utils/sortUsers.ts index 83f5713..8708366 100644 --- a/utils/sortUsers.ts +++ b/utils/sortUsers.ts @@ -1,5 +1,4 @@ import type { UserResponse } from "~/types/interfaces"; -const { getDisplayName } = useProfile() export default (users: UserResponse[]): UserResponse[] => { return users.sort((a, b) => { diff --git a/utils/uuidToDate.ts b/utils/uuidToDate.ts deleted file mode 100644 index f0ab6f3..0000000 --- a/utils/uuidToDate.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default (uuid: string): Date => { - const timeHex = uuid.substring(0, 8) + uuid.substring(9, 13); - const timestamp = parseInt(timeHex, 16); - - return new Date(timestamp); -} \ No newline at end of file