File tree 2 files changed +9
-12
lines changed
2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change
1
+ export const recalcRows = ( rows , schema ) => {
2
+ let s = schema ? schema : useDataset ( ) . props . rowSchema ;
3
+ for ( const record of rows . records ) {
4
+ record . props = recalcRow ( record . props , s ) ;
5
+ }
6
+ }
Original file line number Diff line number Diff line change @@ -45,23 +45,14 @@ recalcGameFields(game);
45
45
await rows .all ();
46
46
47
47
const gameTemplateVars = useGameTemplateVars ();
48
- const unsubscribeFromGameTemplateVars = gameTemplateVars .$onAction (
49
- (e ) => {
50
- /* {
51
- name, // name of the action
52
- store, // store instance, same as `someStore`
53
- args, // array of parameters passed to the action
54
- after, // hook after the action returns or resolves
55
- onError, // hook if the action throws or rejects
56
- }*/
48
+ const unsubscribeFromGameTemplateVars = gameTemplateVars .$onAction ((e ) => {
57
49
if (e .name == ' set' ) {
58
50
e .after ((result ) => {
59
-
60
- console .log (` we should recalc rows because ${ e .name } was triggered with ${ e .store .vars .one } with ${ result} ` );
51
+ recalcRows (rows, dataset .props .rowSchema );
61
52
});
62
53
}
63
54
}
64
- )
55
+ );
65
56
66
57
onBeforeRouteLeave (() => {
67
58
unsubscribeFromGameTemplateVars ();
You can’t perform that action at this time.
0 commit comments