@@ -77,6 +77,7 @@ export enum PaymentChannelActions {
7777
7878 UpdatePerunRequest = 'UpdatePerunRequest' ,
7979 UpdatePerunChannel = 'UpdatePerunChannel' ,
80+ UpdateRunnerState = 'UpdateRunnerState' ,
8081}
8182
8283export type StateAction =
@@ -129,18 +130,22 @@ export type StateAction =
129130 | { type : AppActions . SignVerify ; payload : string }
130131 | { type : AppActions . UpdateConsumeCells ; payload ?: { outPoint : OutPoint ; capacity : string } [ ] }
131132 | { type : AppActions . SetLockWindowInfo ; payload : Required < State . App > [ 'lockWindowInfo' ] }
133+ // | {
134+ // type: PaymentChannelActions.UpdatePerunState
135+ // payload: State.Perun
136+ // }
132137 | {
133- type : PaymentChannelActions . UpdatePerunState
134- payload : State . Perun
135- }
138+ type : PaymentChannelActions . UpdatePerunRequest
139+ payload : Perun . ReadableMessage . Request [ ]
140+ }
136141 | {
137- type : PaymentChannelActions . UpdatePerunRequest
138- payload : Perun . ReadableMessage . Request [ ]
139- }
142+ type : PaymentChannelActions . UpdatePerunChannel
143+ payload : State . PerunChannel [ ]
144+ }
140145 | {
141- type : PaymentChannelActions . UpdatePerunChannel
142- payload : State . PerunChannel [ ]
143- }
146+ type : PaymentChannelActions . UpdateRunnerState
147+ payload : Perun . RunnerStatus
148+ }
144149
145150export type StateDispatch = React . Dispatch < StateAction > // TODO: add type of payload
146151
@@ -341,7 +346,7 @@ export const reducer = produce((state: Draft<State.AppWithNeuronWallet>, action:
341346 */
342347 state . app . showTopAlert =
343348 state . app . notifications . findIndex ( message => message . timestamp === action . payload ) ===
344- state . app . notifications . length - 1
349+ state . app . notifications . length - 1
345350 ? false
346351 : state . app . showTopAlert
347352 state . app . notifications = state . app . notifications . filter ( ( { timestamp } ) => timestamp !== action . payload )
@@ -416,9 +421,9 @@ export const reducer = produce((state: Draft<State.AppWithNeuronWallet>, action:
416421 case AppActions . SetPageNotice : {
417422 state . app . pageNotice = action . payload
418423 ? {
419- ...action . payload ,
420- index : ( state . app . pageNotice ?. index ?? 0 ) + 1 ,
421- }
424+ ...action . payload ,
425+ index : ( state . app . pageNotice ?. index ?? 0 ) + 1 ,
426+ }
422427 : action . payload
423428 break
424429 }
@@ -441,9 +446,12 @@ export const reducer = produce((state: Draft<State.AppWithNeuronWallet>, action:
441446 state . perun . requests = action . payload
442447 break
443448 }
444-
445- case PaymentChannelActions . UpdatePerunChannel : {
446- state . perun . channels = action . payload
449+ // case PaymentChannelActions.UpdatePerunChannel: {
450+ // state.perun.channels = action.payload
451+ // break
452+ // }
453+ case PaymentChannelActions . UpdateRunnerState : {
454+ state . perun . runnerState = action . payload
447455 break
448456 }
449457
0 commit comments