mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2026-08-20 13:27:56 +02:00
Harden multi-node dropdown initialization
This commit is contained in:
parent
cbad48bd32
commit
977a7b382e
2 changed files with 3 additions and 3 deletions
|
|
@ -152,8 +152,8 @@ describe('RTL Root Effects', () => {
|
|||
actions.next({ type: RTLActions.FETCH_APPLICATION_SETTINGS });
|
||||
const sub = effects.appConfigFetch.subscribe((appConfigResponse) => {
|
||||
expect(appConfigResponse).toEqual({ type: RTLActions.SET_APPLICATION_SETTINGS, payload: appConfig });
|
||||
const setSelectedNodeAction = storeDispatchSpy.calls.all()[4].args[0] as any;
|
||||
expect(setSelectedNodeAction.type).toEqual(RTLActions.SET_SELECTED_NODE);
|
||||
const setSelectedNodeAction = storeDispatchSpy.calls.all().find((call) => (call.args[0] as any).type === RTLActions.SET_SELECTED_NODE)?.args[0] as any;
|
||||
expect(setSelectedNodeAction).toBeTruthy();
|
||||
expect(setSelectedNodeAction.payload.currentLnNode.index).toEqual(appConfig.nodes[0].index);
|
||||
done();
|
||||
setTimeout(() => sub.unsubscribe());
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ export class RTLEffects implements OnDestroy {
|
|||
let searchNode: Node | null = null;
|
||||
rtlConfig.nodes.forEach((node) => {
|
||||
node.settings.currencyUnits = [...CURRENCY_UNITS, (node.settings?.currencyUnit ? node.settings?.currencyUnit : '')];
|
||||
if (+(node.index || -1) === +rtlConfig.selectedNodeIndex) {
|
||||
if (+(node.index ?? -1) === +rtlConfig.selectedNodeIndex) {
|
||||
searchNode = node;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue