mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Also include budget in currency conversion.
This commit is contained in:
@@ -48,9 +48,19 @@ export default () => ({
|
||||
}
|
||||
this.getFreshData();
|
||||
},
|
||||
|
||||
eventListeners: {
|
||||
['@convert-to-native.window'](event){
|
||||
console.log('I heard that! (dashboard/budgets)');
|
||||
this.convertToNative = event.detail;
|
||||
chartData = null;
|
||||
this.loadChart();
|
||||
}
|
||||
},
|
||||
|
||||
drawChart(options) {
|
||||
if (null !== chart) {
|
||||
chart.data.datasets = options.data.datasets;
|
||||
chart.data = options.data;
|
||||
chart.update();
|
||||
return;
|
||||
}
|
||||
@@ -59,7 +69,7 @@ export default () => ({
|
||||
getFreshData() {
|
||||
const start = new Date(window.store.get('start'));
|
||||
const end = new Date(window.store.get('end'));
|
||||
const cacheKey = getCacheKey('ds_bdg_chart', {start: start, end: end});
|
||||
const cacheKey = getCacheKey('ds_bdg_chart', {convertToNative: this.convertToNative, start: start, end: end});
|
||||
//const cacheValid = window.store.get('cacheValid');
|
||||
const cacheValid = false;
|
||||
let cachedData = window.store.get(cacheKey);
|
||||
|
||||
@@ -33,6 +33,17 @@ let afterPromises = false;
|
||||
export default () => ({
|
||||
loading: false,
|
||||
convertToNative: false,
|
||||
|
||||
eventListeners: {
|
||||
['@convert-to-native.window'](event){
|
||||
console.log('I heard that! (dashboard/categories)');
|
||||
this.convertToNative = event.detail;
|
||||
chartData = null;
|
||||
this.loadChart();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
generateOptions(data) {
|
||||
currencies = [];
|
||||
let options = getDefaultChartSettings('column');
|
||||
@@ -147,7 +158,7 @@ export default () => ({
|
||||
getFreshData() {
|
||||
const start = new Date(window.store.get('start'));
|
||||
const end = new Date(window.store.get('end'));
|
||||
const cacheKey = getCacheKey('ds_ct_chart', {start: start, end: end});
|
||||
const cacheKey = getCacheKey('ds_ct_chart', {convertToNative: this.convertToNative, start: start, end: end});
|
||||
|
||||
const cacheValid = window.store.get('cacheValid');
|
||||
let cachedData = window.store.get(cacheKey);
|
||||
|
||||
@@ -71,9 +71,10 @@ let index = function () {
|
||||
return {
|
||||
convertToNative: false,
|
||||
saveNativeSettings(event) {
|
||||
setVariable('convert_to_native', event.currentTarget.checked).then(() => {
|
||||
console.log('Set convert to native to: ', event.currentTarget.checked);
|
||||
this.$dispatch('convert-to-native', event.currentTarget.checked);
|
||||
let target = event.currentTarget || event.target;
|
||||
setVariable('convert_to_native',target.checked).then(() => {
|
||||
console.log('Set convert to native to: ', target.checked);
|
||||
this.$dispatch('convert-to-native', target.checked);
|
||||
});
|
||||
},
|
||||
init() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="row mb-2" x-data="budgets">
|
||||
<div class="row mb-2" x-data="budgets" x-bind="eventListeners">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="row mb-2" x-data="categories">
|
||||
<div class="row mb-2" x-data="categories" x-bind="eventListeners">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
||||
Reference in New Issue
Block a user