Commit 8ba52bd 1 parent cb2fa5f commit 8ba52bd Copy full SHA for 8ba52bd
File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,6 @@ Mirakurun: Apache License
255
255
/// <reference types="react" />
256
256
/// <reference types="scheduler" />
257
257
258
- import { useToast } from "react-toastify"
259
258
import * as Recoil from "recoil"
260
259
261
260
type GlobalEvent = Event & {
@@ -38495,6 +38494,9 @@ export declare type CustomComponent = {
38495
38494
id: string
38496
38495
component: React.VFC<{}>
38497
38496
}
38497
+ export declare type OnBackgroundComponent = {
38498
+ position: "onBackground"
38499
+ } & CustomComponent
38498
38500
export declare type OnSplashComponent = {
38499
38501
position: "onSplash"
38500
38502
} & CustomComponent
@@ -38512,6 +38514,7 @@ export declare type OnForwardComponent = {
38512
38514
position: "onForward"
38513
38515
} & CustomComponent
38514
38516
export declare type ComponentWithPosition =
38517
+ | OnBackgroundComponent
38515
38518
| OnSplashComponent
38516
38519
| OnSettingComponent
38517
38520
| OnPlayerComponent
@@ -38530,9 +38533,7 @@ export declare type PluginInRendererArgs = {
38530
38533
functions: {
38531
38534
openWindow: (args: OpenWindowArg) => Promise<number>
38532
38535
}
38533
- hooks: {
38534
- useToast: typeof useToast
38535
- }
38536
+ hooks: {}
38536
38537
atoms: {
38537
38538
globalContentPlayerIdsSelector: Recoil.RecoilValueReadOnly<number[]>
38538
38539
globalContentPlayerPlayingContentFamily: (
Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ const main: InitPlugin = {
77
77
} ,
78
78
components : [
79
79
{
80
- id : `${ prefix } .player ` ,
81
- position : "onPlayer " ,
80
+ id : `${ prefix } .background ` ,
81
+ position : "onBackground " ,
82
82
label : meta . name ,
83
83
component : ( ) => {
84
84
const activeWindowId = useRecoilValue (
@@ -94,13 +94,18 @@ const main: InitPlugin = {
94
94
const isPlaying = useRecoilValue ( atoms . contentPlayerIsPlayingAtom )
95
95
const isEnabled = useRecoilValue ( isEnabledAtom )
96
96
useEffect ( ( ) => {
97
- if ( ! isEnabled || ! isPlaying ) {
97
+ if (
98
+ ! isEnabled ||
99
+ activeWindowId === null ||
100
+ ( ! isPlaying && remoteWindow . id === activeWindowId )
101
+ ) {
98
102
packages . IpcRenderer . invoke ( activityEventId , null )
99
103
return
100
104
}
101
105
if (
102
106
remoteWindow . id !== activeWindowId ||
103
- ! playingContent ?. service
107
+ ! playingContent ?. service ||
108
+ ! isPlaying
104
109
) {
105
110
return
106
111
}
You can’t perform that action at this time.
0 commit comments