File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed
awesome_dashboard/static/src/dashboard Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 1- import { Component , onWillStart , useState } from "@odoo/owl" ;
1+ import { Component , onWillStart , reactive } from "@odoo/owl" ;
22import { registry } from "@web/core/registry" ;
33import { useService } from "@web/core/utils/hooks" ;
44import { Layout } from "@web/search/layout" ;
@@ -12,8 +12,7 @@ class AwesomeDashboard extends Component {
1212
1313 setup ( ) {
1414 this . action = useService ( "action" ) ;
15- this . statisticService = useService ( "statistics" ) ;
16- this . statistics = useState ( this . statisticService ) ;
15+ this . state = reactive ( { statistics : useService ( "statistics" ) } ) ;
1716 this . items = dashboard_items ;
1817 }
1918
Original file line number Diff line number Diff line change 1717 <div class =" d-flex align-items-start flex-wrap" >
1818 <t t-foreach =" items" t-as =" item" t-key =" item.id" >
1919 <DashboardItem size =" item.size || 1" >
20- <t t-set =" itemProp" t-value =" item.props ? item.props(statistics) : {'data': statistics}" />
20+ <t t-set =" itemProp" t-value =" item.props ? item.props(state. statistics) : {'data': state. statistics}" />
2121 <t t-component =" item.Component" t-props =" itemProp" />
2222 </DashboardItem >
2323 </t >
Original file line number Diff line number Diff line change 1- import { reactive } from "@odoo/owl" ;
21import { rpc } from "@web/core/network/rpc" ;
32import { registry } from "@web/core/registry" ;
43import { memoize } from "@web/core/utils/functions" ;
@@ -9,7 +8,7 @@ export async function loadStatistic() {
98
109export const statisticsService = {
1110 async start ( ) {
12- const data = reactive ( await loadStatistic ( ) ) ;
11+ let data = await loadStatistic ( ) ;
1312
1413 setInterval ( async ( ) => {
1514 data = await loadStatistic ( ) ;
You can’t perform that action at this time.
0 commit comments