refactor: ♻️ Fix linter errors

This commit is contained in:
Jesse Wierzbinski 2024-06-19 14:07:56 -10:00
parent 8a984abfb2
commit f9433e259b
No known key found for this signature in database
30 changed files with 235 additions and 157 deletions

View file

@ -50,7 +50,9 @@ const openLightbox = () => {
};
const formatBytes = (bytes: number) => {
if (bytes === 0) return "0 Bytes";
if (bytes === 0) {
return "0 Bytes";
}
const k = 1000;
const dm = 2;
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];

View file

@ -206,7 +206,9 @@ const numberFormat = (number = 0) =>
}).format(number);
const likeFn = async () => {
if (!outputtedNote.value) return;
if (!outputtedNote.value) {
return;
}
if (outputtedNote.value.favourited) {
const output = await client.value.unfavouriteStatus(
outputtedNote.value.id,
@ -227,7 +229,9 @@ const likeFn = async () => {
};
const reblogFn = async () => {
if (!outputtedNote.value) return;
if (!outputtedNote.value) {
return;
}
if (outputtedNote.value?.reblogged) {
const output = await client.value.unreblogStatus(
outputtedNote.value.id,

View file

@ -43,7 +43,9 @@ const { relationship } = useRelationship(
);
const acceptFollowRequest = async () => {
if (!props.notification?.account) return;
if (!props.notification?.account) {
return;
}
isWorkingOnFollowRequest.value = true;
const { data } = await client.value.acceptFollowRequest(
props.notification.account.id,
@ -53,7 +55,9 @@ const acceptFollowRequest = async () => {
};
const rejectFollowRequest = async () => {
if (!props.notification?.account) return;
if (!props.notification?.account) {
return;
}
isWorkingOnFollowRequest.value = true;
const { data } = await client.value.rejectFollowRequest(
props.notification.account.id,
@ -69,7 +73,9 @@ const { display_name } = useParsedAccount(
);
const text = computed(() => {
if (!props.notification) return "";
if (!props.notification) {
return "";
}
switch (props.notification.type) {
case "mention":
@ -82,13 +88,16 @@ const text = computed(() => {
return "followed you";
case "follow_request":
return "requested to follow you";
default:
default: {
console.error("Unknown notification type", props.notification.type);
return "";
}
}
});
const icon = computed(() => {
if (!props.notification) return "";
if (!props.notification) {
return "";
}
switch (props.notification.type) {
case "mention":

View file

@ -112,7 +112,9 @@ const accountId = computed(() => props.account?.id ?? null);
const { relationship, isLoading } = useRelationship(client, accountId);
const follow = () => {
if (!identity.value || !props.account || !relationship.value) return;
if (!(identity.value && props.account && relationship.value)) {
return;
}
relationship.value = {
...relationship.value,
following: true,
@ -120,7 +122,9 @@ const follow = () => {
};
const unfollow = () => {
if (!identity.value || !props.account || !relationship.value) return;
if (!(identity.value && props.account && relationship.value)) {
return;
}
relationship.value = {
...relationship.value,
following: false,