feat: Account-Screen mit Nutzerprofil, App-Version aus package.json

- AccountScreen zeigt jetzt Profilbild, Anzeigename und @Login des eingeloggten Twitch-Nutzers (via neuem IPC-Kanal twitch:get-own-user)
- CSS: account__avatar zeigt Profilbild, neue Klassen für identity, name, login und error
This commit is contained in:
Andre
2026-04-25 16:14:59 +02:00
parent eeddcb9dff
commit f365170ded
9 changed files with 154 additions and 5 deletions
+2
View File
@@ -16,6 +16,7 @@ export const IPC = {
authEvent: 'auth:event',
twitchGetFollowed: 'twitch:get-followed',
twitchGetOwnUser: 'twitch:get-own-user',
twitchGetVideos: 'twitch:get-videos',
twitchGetTopGames: 'twitch:get-top-games',
twitchGetTopStreams: 'twitch:get-top-streams',
@@ -61,6 +62,7 @@ export function registerIpcHandlers(
})
ipcMain.handle(IPC.twitchGetFollowed, () => helix.getFollowedWithLiveStatus())
ipcMain.handle(IPC.twitchGetOwnUser, () => helix.getOwnUserInfo())
ipcMain.handle(
IPC.twitchGetTopGames,
(_e, cursor?: string) => helix.getTopGames(40, cursor)
+11
View File
@@ -5,6 +5,7 @@ import type {
HelixGame,
HelixPaginatedResponse,
HelixStream,
OwnUserInfo,
TopStreamsResult,
HelixUser,
HelixVideo,
@@ -62,6 +63,16 @@ export class HelixClient {
return user
}
async getOwnUserInfo(): Promise<OwnUserInfo> {
const user = await this.getOwnUser()
return {
id: user.id,
login: user.login,
displayName: user.display_name,
profileImageUrl: user.profile_image_url
}
}
private async getOwnUserId(): Promise<string> {
if (this.cachedUserId) return this.cachedUserId
const user = await this.getOwnUser()
+7
View File
@@ -5,6 +5,13 @@ export interface HelixUser {
profile_image_url: string
}
export interface OwnUserInfo {
id: string
login: string
displayName: string
profileImageUrl: string
}
export interface HelixFollowedChannel {
broadcaster_id: string
broadcaster_login: string