mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Method should not be async
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -30,10 +30,10 @@
|
|||||||
"integrity": "sha384-B73JAwYNSgI4rwb14zwxigHgAkg1Ms+j6+9sJoDpiL11+VW5RjQCLfIh0RVoi0h6"
|
"integrity": "sha384-B73JAwYNSgI4rwb14zwxigHgAkg1Ms+j6+9sJoDpiL11+VW5RjQCLfIh0RVoi0h6"
|
||||||
},
|
},
|
||||||
"resources/assets/v2/pages/dashboard/dashboard.js": {
|
"resources/assets/v2/pages/dashboard/dashboard.js": {
|
||||||
"file": "assets/dashboard-9c9be7cf.js",
|
"file": "assets/dashboard-2100f404.js",
|
||||||
"isEntry": true,
|
"isEntry": true,
|
||||||
"src": "resources/assets/v2/pages/dashboard/dashboard.js",
|
"src": "resources/assets/v2/pages/dashboard/dashboard.js",
|
||||||
"integrity": "sha384-fpX8mrTJxfFxKxTS5d9M+3SJnQE9ePo1Re15lATVi+Q165igCJ6/Rs/mXyezYI4G"
|
"integrity": "sha384-V9FlCSPQuNaRj8izLok2N3wJYIFCKB/T3n+8gr7HB1r90GH086BF99Wrwel2tHnQ"
|
||||||
},
|
},
|
||||||
"resources/assets/v2/sass/app.scss": {
|
"resources/assets/v2/sass/app.scss": {
|
||||||
"file": "assets/app-28a195fd.css",
|
"file": "assets/app-28a195fd.css",
|
||||||
|
@@ -35,9 +35,6 @@ let chart = null;
|
|||||||
let chartData = null;
|
let chartData = null;
|
||||||
let afterPromises = false;
|
let afterPromises = false;
|
||||||
|
|
||||||
const CHART_CACHE_KEY = 'dashboard-accounts-chart';
|
|
||||||
const ACCOUNTS_CACHE_KEY = 'dashboard-accounts-data';
|
|
||||||
|
|
||||||
export default () => ({
|
export default () => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
loadingAccounts: false,
|
loadingAccounts: false,
|
||||||
@@ -51,12 +48,13 @@ export default () => ({
|
|||||||
getFreshData() {
|
getFreshData() {
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const chartCacheKey = getCacheKey(CHART_CACHE_KEY, start, end)
|
const chartCacheKey = getCacheKey('dashboard-accounts-chart', start, end)
|
||||||
|
|
||||||
const cacheValid = window.store.get('cacheValid');
|
const cacheValid = window.store.get('cacheValid');
|
||||||
let cachedData = window.store.get(chartCacheKey);
|
let cachedData = window.store.get(chartCacheKey);
|
||||||
|
|
||||||
if (cacheValid && typeof cachedData !== 'undefined') {
|
if (cacheValid && typeof cachedData !== 'undefined') {
|
||||||
|
console.log(cachedData);
|
||||||
this.drawChart(this.generateOptions(cachedData));
|
this.drawChart(this.generateOptions(cachedData));
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
return;
|
return;
|
||||||
@@ -66,6 +64,7 @@ export default () => ({
|
|||||||
this.chartData = response.data;
|
this.chartData = response.data;
|
||||||
// cache generated options:
|
// cache generated options:
|
||||||
window.store.set(chartCacheKey, response.data);
|
window.store.set(chartCacheKey, response.data);
|
||||||
|
console.log(response.data);
|
||||||
this.drawChart(this.generateOptions(this.chartData));
|
this.drawChart(this.generateOptions(this.chartData));
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
@@ -168,7 +167,7 @@ export default () => ({
|
|||||||
}
|
}
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const accountCacheKey = getCacheKey(ACCOUNTS_CACHE_KEY, start, end);
|
const accountCacheKey = getCacheKey('dashboard-accounts-data', start, end);
|
||||||
|
|
||||||
const cacheValid = window.store.get('cacheValid');
|
const cacheValid = window.store.get('cacheValid');
|
||||||
let cachedData = window.store.get(accountCacheKey);
|
let cachedData = window.store.get(accountCacheKey);
|
||||||
|
@@ -25,7 +25,6 @@ import formatMoney from "../../util/format-money.js";
|
|||||||
import {getCacheKey} from "../../support/get-cache-key.js";
|
import {getCacheKey} from "../../support/get-cache-key.js";
|
||||||
|
|
||||||
let afterPromises = false;
|
let afterPromises = false;
|
||||||
const CACHE_KEY = 'dashboard-boxes-data';
|
|
||||||
export default () => ({
|
export default () => ({
|
||||||
balanceBox: {amounts: [], subtitles: []},
|
balanceBox: {amounts: [], subtitles: []},
|
||||||
billBox: {paid: [], unpaid: []},
|
billBox: {paid: [], unpaid: []},
|
||||||
@@ -38,7 +37,7 @@ export default () => ({
|
|||||||
getFreshData() {
|
getFreshData() {
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const boxesCacheKey = getCacheKey(CACHE_KEY, start, end);
|
const boxesCacheKey = getCacheKey('dashboard-boxes-data', start, end);
|
||||||
|
|
||||||
const cacheValid = window.store.get('cacheValid');
|
const cacheValid = window.store.get('cacheValid');
|
||||||
let cachedData = window.store.get(boxesCacheKey);
|
let cachedData = window.store.get(boxesCacheKey);
|
||||||
|
@@ -34,7 +34,6 @@ let afterPromises = false;
|
|||||||
|
|
||||||
let i18n; // for translating items in the chart.
|
let i18n; // for translating items in the chart.
|
||||||
|
|
||||||
const CACHE_KEY = 'dashboard-budgets-chart';
|
|
||||||
export default () => ({
|
export default () => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
autoConversion: false,
|
autoConversion: false,
|
||||||
@@ -62,7 +61,7 @@ export default () => ({
|
|||||||
getFreshData() {
|
getFreshData() {
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const cacheKey = getCacheKey(CACHE_KEY, start, end);
|
const cacheKey = getCacheKey('dashboard-budgets-chart', start, end);
|
||||||
const cacheValid = window.store.get('cacheValid');
|
const cacheValid = window.store.get('cacheValid');
|
||||||
let cachedData = window.store.get(cacheKey);
|
let cachedData = window.store.get(cacheKey);
|
||||||
|
|
||||||
|
@@ -30,8 +30,6 @@ let chart = null;
|
|||||||
let chartData = null;
|
let chartData = null;
|
||||||
let afterPromises = false;
|
let afterPromises = false;
|
||||||
|
|
||||||
const CACHE_KEY = 'dashboard-categories-chart';
|
|
||||||
|
|
||||||
export default () => ({
|
export default () => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
autoConversion: false,
|
autoConversion: false,
|
||||||
@@ -149,7 +147,7 @@ export default () => ({
|
|||||||
getFreshData() {
|
getFreshData() {
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const cacheKey = getCacheKey(CACHE_KEY, start, end);
|
const cacheKey = getCacheKey('dashboard-categories-chart', start, end);
|
||||||
|
|
||||||
const cacheValid = window.store.get('cacheValid');
|
const cacheValid = window.store.get('cacheValid');
|
||||||
let cachedData = window.store.get(cacheKey);
|
let cachedData = window.store.get(cacheKey);
|
||||||
|
@@ -27,7 +27,7 @@ import {format} from "date-fns";
|
|||||||
let apiData = {};
|
let apiData = {};
|
||||||
let afterPromises = false;
|
let afterPromises = false;
|
||||||
let i18n;
|
let i18n;
|
||||||
const CACHE_KEY = 'dashboard-piggies-data';
|
const PIGGY_CACHE_KEY = 'dashboard-piggies-data';
|
||||||
|
|
||||||
export default () => ({
|
export default () => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -37,7 +37,7 @@ export default () => ({
|
|||||||
getFreshData() {
|
getFreshData() {
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const cacheKey = getCacheKey(CACHE_KEY, start, end);
|
const cacheKey = getCacheKey(PIGGY_CACHE_KEY, start, end);
|
||||||
|
|
||||||
const cacheValid = window.store.get('cacheValid');
|
const cacheValid = window.store.get('cacheValid');
|
||||||
let cachedData = window.store.get(cacheKey);
|
let cachedData = window.store.get(cacheKey);
|
||||||
@@ -59,7 +59,7 @@ export default () => ({
|
|||||||
downloadPiggyBanks(params) {
|
downloadPiggyBanks(params) {
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const cacheKey = getCacheKey(CACHE_KEY, start, end);
|
const cacheKey = getCacheKey(PIGGY_CACHE_KEY, start, end);
|
||||||
const getter = new Get();
|
const getter = new Get();
|
||||||
getter.get(params).then((response) => {
|
getter.get(params).then((response) => {
|
||||||
apiData = [...apiData, ...response.data.data];
|
apiData = [...apiData, ...response.data.data];
|
||||||
|
@@ -29,7 +29,7 @@ import {format} from "date-fns";
|
|||||||
|
|
||||||
Chart.register({SankeyController, Flow});
|
Chart.register({SankeyController, Flow});
|
||||||
|
|
||||||
const CACHE_KEY = 'dashboard-sankey-data';
|
const SANKEY_CACHE_KEY = 'dashboard-sankey-data';
|
||||||
let i18n;
|
let i18n;
|
||||||
let currencies = [];
|
let currencies = [];
|
||||||
let afterPromises = false;
|
let afterPromises = false;
|
||||||
@@ -290,7 +290,7 @@ export default () => ({
|
|||||||
getFreshData() {
|
getFreshData() {
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const cacheKey = getCacheKey(CACHE_KEY, start, end);
|
const cacheKey = getCacheKey(SANKEY_CACHE_KEY, start, end);
|
||||||
|
|
||||||
const cacheValid = window.store.get('cacheValid');
|
const cacheValid = window.store.get('cacheValid');
|
||||||
let cachedData = window.store.get(cacheKey);
|
let cachedData = window.store.get(cacheKey);
|
||||||
@@ -314,7 +314,7 @@ export default () => ({
|
|||||||
downloadTransactions(params) {
|
downloadTransactions(params) {
|
||||||
const start = new Date(window.store.get('start'));
|
const start = new Date(window.store.get('start'));
|
||||||
const end = new Date(window.store.get('end'));
|
const end = new Date(window.store.get('end'));
|
||||||
const cacheKey = getCacheKey(CACHE_KEY, start, end);
|
const cacheKey = getCacheKey(SANKEY_CACHE_KEY, start, end);
|
||||||
|
|
||||||
//console.log('Downloading page ' + params.page + '...');
|
//console.log('Downloading page ' + params.page + '...');
|
||||||
const getter = new Get();
|
const getter = new Get();
|
||||||
|
@@ -32,7 +32,6 @@ import formatMoney from "../../util/format-money.js";
|
|||||||
let afterPromises = false;
|
let afterPromises = false;
|
||||||
let i18n; // for translating items in the chart.
|
let i18n; // for translating items in the chart.
|
||||||
let apiData = [];
|
let apiData = [];
|
||||||
const SUBSCRIPTION_CACHE_KEY = 'subscriptions-data-dashboard';
|
|
||||||
let subscriptionData = {};
|
let subscriptionData = {};
|
||||||
|
|
||||||
function downloadSubscriptions(params) {
|
function downloadSubscriptions(params) {
|
||||||
@@ -191,7 +190,7 @@ export default () => ({
|
|||||||
|
|
||||||
console.log('here we are');
|
console.log('here we are');
|
||||||
const cacheValid = window.store.get('cacheValid');
|
const cacheValid = window.store.get('cacheValid');
|
||||||
let cachedData = window.store.get(getCacheKey(SUBSCRIPTION_CACHE_KEY, start, end));
|
let cachedData = window.store.get(getCacheKey('subscriptions-data-dashboard', start, end));
|
||||||
|
|
||||||
if (cacheValid && typeof cachedData !== 'undefined' && false) {
|
if (cacheValid && typeof cachedData !== 'undefined' && false) {
|
||||||
console.error('cannot handle yet');
|
console.error('cannot handle yet');
|
||||||
|
@@ -20,10 +20,10 @@
|
|||||||
|
|
||||||
import {format} from "date-fns";
|
import {format} from "date-fns";
|
||||||
|
|
||||||
async function getCacheKey(string, start, end) {
|
function getCacheKey(string, start, end) {
|
||||||
const cacheKey = format(start, 'y-MM-dd') + '_' + format(end, 'y-MM-dd') + '_' + string;
|
const cacheKey = format(start, 'y-MM-dd') + '_' + format(end, 'y-MM-dd') + '_' + string;
|
||||||
console.log('getCacheKey: ' + cacheKey);
|
console.log('getCacheKey: ' + cacheKey);
|
||||||
return cacheKey;
|
return String(cacheKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
export {getCacheKey};
|
export {getCacheKey};
|
||||||
|
Reference in New Issue
Block a user