feat: use jpg for system notifications

This commit is contained in:
Zamitto
2025-11-12 08:17:53 -03:00
parent f84917a00b
commit c2216bbf95
5 changed files with 17 additions and 12 deletions

View File

@@ -5,15 +5,15 @@ const processProfileImageEvent = async (
_event: Electron.IpcMainInvokeEvent,
path: string
) => {
return processProfileImage(path);
return processProfileImage(path, "webp");
};
export const processProfileImage = async (path: string) => {
export const processProfileImage = async (path: string, extension?: string) => {
return PythonRPC.rpc
.post<{
imagePath: string;
mimeType: string;
}>("/profile-image", { image_path: path })
}>("/profile-image", { image_path: path, target_extension: extension })
.then((response) => response.data);
};

View File

@@ -18,7 +18,7 @@ import { getThemeSoundPath } from "@main/helpers";
import { processProfileImage } from "@main/events/profile/process-profile-image";
const getStaticImage = async (path: string) => {
return processProfileImage(path)
return processProfileImage(path, "jpg")
.then((response) => response.imagePath)
.catch(() => path);
};

View File

@@ -8,9 +8,11 @@ export const friendRequestEvent = async (payload: FriendRequest) => {
friendRequestCount: payload.friendRequestCount,
});
const user = await HydraApi.get(`/users/${payload.senderId}`);
if (payload.senderId) {
const user = await HydraApi.get(`/users/${payload.senderId}`);
if (user) {
publishNewFriendRequestNotification(user);
if (user) {
publishNewFriendRequestNotification(user);
}
}
};