Skip to content

Commit

Permalink
🎨 [drpc] サービスが拾えてなくてもPresenceを設定
Browse files Browse the repository at this point in the history
  • Loading branch information
ci7lus committed Oct 10, 2021
1 parent 336eb52 commit 996316b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/miraktest-drpc/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,13 @@ const main: InitPlugin = {
packages.IpcRenderer.invoke(activityEventId, null)
return
}
if (
remoteWindow.id !== activeWindowId ||
!playingContent?.service ||
!isPlaying
) {
if (remoteWindow.id !== activeWindowId || !isPlaying) {
return
}
const service = playingContent.service
const program = playingContent.program
const service = playingContent?.service
const program = playingContent?.program
const version = `${appInfo.name} ${appInfo.version}`
const logo = getServiceLogoForPresence(service)
const logo = service && getServiceLogoForPresence(service)
const largeImageKey = logo || "miraktest_icon"
const smallImageKey = logo ? "miraktest_icon" : undefined
const largeImageText = logo ? service.name : version
Expand All @@ -129,7 +125,7 @@ const main: InitPlugin = {
logo && description && 2 <= description.length
const details = isDisplayDescription
? programName
: service.name
: service?.name
const state =
isDisplayDescription && description
? 128 < description.length
Expand Down Expand Up @@ -164,7 +160,7 @@ const main: InitPlugin = {
largeImageText,
smallImageKey,
smallImageText,
details: service.name,
details: service?.name,
instance: false,
}
packages.IpcRenderer.invoke(activityEventId, activity)
Expand Down

0 comments on commit 996316b

Please sign in to comment.