@mx-cartographer/experiences 9.3.1-alpha.al0 → 9.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -7
- package/dist/cashflow/CashflowOnboarding.es.js +1 -1
- package/dist/core/api/SettingsApi.d.ts +0 -4
- package/dist/core/api/SettingsApi.es.js +4 -5
- package/dist/core/api/SettingsApi.es.js.map +1 -1
- package/dist/core/constants/ApiEndpoints.d.ts +0 -1
- package/dist/core/constants/ApiEndpoints.es.js +0 -1
- package/dist/core/constants/ApiEndpoints.es.js.map +1 -1
- package/dist/core/stores/CategoryStore.es.js +46 -46
- package/dist/core/stores/CategoryStore.es.js.map +1 -1
- package/dist/core/stores/FinstrongStore.es.js +1 -1
- package/dist/core/stores/SettingsStore.d.ts +0 -4
- package/dist/core/stores/SettingsStore.es.js +73 -80
- package/dist/core/stores/SettingsStore.es.js.map +1 -1
- package/dist/core/types/localization/SettingsCopy.d.ts +0 -6
- package/dist/core/utils/DateUtil.d.ts +1 -0
- package/dist/core/utils/DateUtil.es.js +48 -47
- package/dist/core/utils/DateUtil.es.js.map +1 -1
- package/dist/core/utils/DebtUtils.es.js +6 -6
- package/dist/core/utils/GoalsUtil.es.js +1 -1
- package/dist/core/utils/RecurringTransactionsUtil.es.js +5 -5
- package/dist/core/utils/TransactionUtils.es.js +1 -1
- package/dist/goals/components/actions/BirthdayAction.es.js +1 -1
- package/dist/recurringtransactions/components/RecurringTransactionList.es.js +4 -4
- package/dist/settings/components/profile/ProfileTab.d.ts +1 -1
- package/dist/settings/components/profile/ProfileTab.es.js +108 -115
- package/dist/settings/components/profile/ProfileTab.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyEmailAction.es.js +37 -20
- package/dist/settings/components/profile/actions/VerifyEmailAction.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyPhoneAction.es.js +17 -11
- package/dist/settings/components/profile/actions/VerifyPhoneAction.es.js.map +1 -1
- package/dist/settings/constants/Settings.d.ts +0 -8
- package/dist/settings/constants/Settings.es.js +3 -10
- package/dist/settings/constants/Settings.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/settings/components/profile/actions/ResetPasswordAction.d.ts +0 -4
- package/dist/settings/components/profile/actions/ResetPasswordAction.es.js +0 -94
- package/dist/settings/components/profile/actions/ResetPasswordAction.es.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
## [9.3.1] - 08-
|
|
1
|
+
## [9.3.1] - 08-10-2026
|
|
2
2
|
|
|
3
|
-
- **
|
|
4
|
-
- **ADDED** - `CHANGE_PASSWORD` API endpoint and `updatePassword` store action with success/error alerts (MEW-3722)
|
|
5
|
-
- **CHANGED** - Refactored `VerifyEmailAction` and `VerifyPhoneAction` dialogs to use `Dialog` copy title prop instead of inline text (MEW-3722)
|
|
6
|
-
- **CHANGED** - Replaced hardcoded widths in `ProfileTab` with flex layout for responsive behavior (MEW-3722)
|
|
7
|
-
- **FIXED** - Typo `handleOnLeavClick` → `handleOnLeaveClick` in `ProfileTab` (MEW-3722)
|
|
3
|
+
- **FIXED** - Spending, Trends, Finstrong, and Budgets category totals used the viewer's local-midnight timestamps, shifting the query window by the timezone offset for non-UTC users and dropping/gaining boundary transactions; date-range boundaries are now sent as UTC calendar days
|
|
8
4
|
|
|
9
5
|
## [9.3.0] - 08-06-2026
|
|
10
6
|
|
|
@@ -23,7 +19,6 @@
|
|
|
23
19
|
- **CHANGED** - Pinned `msw` to an exact `2.15.0` to match the vendored `mockServiceWorker.js`, and `Beats.js` → `Beats.ts`
|
|
24
20
|
- **ADDED** - `src/core/api/__tests__/ApiClasses.test.ts` exercising the real `src/core/api/*` classes against MSW; coverage now includes `src/core/api/**` in the denominator (the MSW migration runs the real API classes) with the REVIEW.md floors kept at lines 85 / statements 85 / functions 80 / branches 78 (tests added to clear them rather than lowering), and `coverage.cleanOnRerun` set to `true` so a re-run can't satisfy the floors with stale data
|
|
25
21
|
- **CHANGED** - Dependency/structure hygiene: removed the unused `path` userland shim (configs use `node:path`); documented why `@typescript/typescript6` is retained (vite-plugin-dts needs the JS Compiler API that TS 7 native doesn't yet expose); consolidated the root `mockData/` fixtures into `mock/data/`
|
|
26
|
-
|
|
27
22
|
## [9.2.9] - 08-09-2026
|
|
28
23
|
|
|
29
24
|
- **FIXED** - Category selector drawer kept the previously expanded accordion and highlighted selection when reopened for a different transaction; it now resets and expands to the current transaction's category each time it opens
|
|
@@ -24,8 +24,8 @@ import { Fragment as G, jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
|
24
24
|
import { keyframes as Te, useTheme as Ce } from "@mui/material/styles";
|
|
25
25
|
import p from "@mui/material/Box";
|
|
26
26
|
import { subDays as ke } from "date-fns/subDays";
|
|
27
|
-
import { getUnixTime as Ie } from "date-fns/getUnixTime";
|
|
28
27
|
import { fromUnixTime as U } from "date-fns/fromUnixTime";
|
|
28
|
+
import { getUnixTime as Ie } from "date-fns/getUnixTime";
|
|
29
29
|
import { formatISO as we } from "date-fns/formatISO";
|
|
30
30
|
import L from "@mui/material/Divider";
|
|
31
31
|
import ve from "@mui/material/List";
|
|
@@ -15,9 +15,5 @@ export declare class SettingsApi {
|
|
|
15
15
|
updateDevice: (device: Device) => Promise<any>;
|
|
16
16
|
updateNotificationProfile: (notificationProfile: NotificationProfile) => Promise<any>;
|
|
17
17
|
updateUserCommunicationProfile: (userCommunicationProfile: UserCommunicationProfile) => Promise<any>;
|
|
18
|
-
updatePassword: (params: {
|
|
19
|
-
new_password: string;
|
|
20
|
-
new_password_again: string;
|
|
21
|
-
}) => Promise<any>;
|
|
22
18
|
getInsightsNotificationProfiles: () => Promise<any>;
|
|
23
19
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ApiEndpoints as n } from "../constants/ApiEndpoints.es.js";
|
|
2
|
-
import { Fetch as
|
|
3
|
-
var
|
|
2
|
+
import { Fetch as c } from "../utils/Fetch.es.js";
|
|
3
|
+
var r = class {
|
|
4
4
|
fetchInstance;
|
|
5
5
|
constructor(e, t, i) {
|
|
6
|
-
this.fetchInstance = new
|
|
6
|
+
this.fetchInstance = new c(e, t, void 0, i);
|
|
7
7
|
}
|
|
8
8
|
deleteDevice = async (e) => this.fetchInstance.delete(`${n.DEVICES}/${e}`).then((t) => t);
|
|
9
9
|
generateDeviceToken = async () => this.fetchInstance.get(`${n.USER}/mobile_token`).then((e) => e.mobile_token);
|
|
@@ -15,11 +15,10 @@ var I = class {
|
|
|
15
15
|
updateDevice = async (e) => this.fetchInstance.put(`${n.DEVICES}/${e.guid}`, e).then((t) => t.device);
|
|
16
16
|
updateNotificationProfile = async (e) => this.fetchInstance.put(`${n.NOTIFICATION_PROFILES}/${e.guid}`, e).then((t) => t.notification_profile);
|
|
17
17
|
updateUserCommunicationProfile = async (e) => this.fetchInstance.put(n.USER_COMMUNICATION_PROFILE, e).then((t) => t.user_communication_profile);
|
|
18
|
-
updatePassword = async (e) => this.fetchInstance.put(n.CHANGE_PASSWORD, e);
|
|
19
18
|
getInsightsNotificationProfiles = async () => this.fetchInstance.get(`${n.NOTIFICATION_PROFILES}/${n.INSIGHTS_NOTIFICATION_PROFILES}`).then((e) => e);
|
|
20
19
|
};
|
|
21
20
|
export {
|
|
22
|
-
|
|
21
|
+
r as SettingsApi
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=SettingsApi.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsApi.es.js","names":[],"sources":["../../../src/core/api/SettingsApi.ts"],"sourcesContent":["import { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport { UserCommunicationProfile } from '..'\nimport type { Device, GlobalErrorHandler, NotificationProfile } from '..'\n\nexport class SettingsApi {\n fetchInstance: Fetch\n\n constructor(endpoint: string, token: string, onError?: GlobalErrorHandler) {\n this.fetchInstance = new Fetch(endpoint, token, undefined, onError)\n }\n\n deleteDevice = async (guid: string) => {\n return this.fetchInstance.delete(`${ApiEndpoints.DEVICES}/${guid}`).then((data) => data)\n }\n\n generateDeviceToken = async () => {\n return this.fetchInstance\n .get(`${ApiEndpoints.USER}/mobile_token`)\n .then((data) => data.mobile_token)\n }\n\n getDevices = async () => {\n return this.fetchInstance\n .get(ApiEndpoints.DEVICES)\n .then((data) => data.map((item: { device: Device }) => item.device))\n }\n\n getNotificationProfiles = async () => {\n return this.fetchInstance\n .get(ApiEndpoints.NOTIFICATION_PROFILES)\n .then((data) => data.notification_profiles)\n }\n\n // verifications endpoints respond with HTTP status codes; they error otherwise\n sendEmailVerification = async () => {\n return this.fetchInstance.post(ApiEndpoints.EMAIL_VERIFICATIONS)\n }\n\n sendPhoneVerification = async () => {\n return this.fetchInstance.post(ApiEndpoints.PHONE_VERIFICATIONS + '/deliver')\n }\n\n verifyPhoneToken = async (sms_verification_token: string) => {\n return this.fetchInstance\n .post(ApiEndpoints.PHONE_VERIFICATIONS + '/verify', { sms_verification_token })\n .then((res) => ({ verified: res.verified }))\n }\n\n updateDevice = async (device: Device) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.DEVICES}/${device.guid}`, device)\n .then((data) => data.device)\n }\n\n updateNotificationProfile = async (notificationProfile: NotificationProfile) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.NOTIFICATION_PROFILES}/${notificationProfile.guid}`, notificationProfile)\n .then((data) => data.notification_profile)\n }\n\n updateUserCommunicationProfile = async (userCommunicationProfile: UserCommunicationProfile) => {\n return this.fetchInstance\n .put(ApiEndpoints.USER_COMMUNICATION_PROFILE, userCommunicationProfile)\n .then((data) => data.user_communication_profile)\n }\n\n
|
|
1
|
+
{"version":3,"file":"SettingsApi.es.js","names":[],"sources":["../../../src/core/api/SettingsApi.ts"],"sourcesContent":["import { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport { UserCommunicationProfile } from '..'\nimport type { Device, GlobalErrorHandler, NotificationProfile } from '..'\n\nexport class SettingsApi {\n fetchInstance: Fetch\n\n constructor(endpoint: string, token: string, onError?: GlobalErrorHandler) {\n this.fetchInstance = new Fetch(endpoint, token, undefined, onError)\n }\n\n deleteDevice = async (guid: string) => {\n return this.fetchInstance.delete(`${ApiEndpoints.DEVICES}/${guid}`).then((data) => data)\n }\n\n generateDeviceToken = async () => {\n return this.fetchInstance\n .get(`${ApiEndpoints.USER}/mobile_token`)\n .then((data) => data.mobile_token)\n }\n\n getDevices = async () => {\n return this.fetchInstance\n .get(ApiEndpoints.DEVICES)\n .then((data) => data.map((item: { device: Device }) => item.device))\n }\n\n getNotificationProfiles = async () => {\n return this.fetchInstance\n .get(ApiEndpoints.NOTIFICATION_PROFILES)\n .then((data) => data.notification_profiles)\n }\n\n // verifications endpoints respond with HTTP status codes; they error otherwise\n sendEmailVerification = async () => {\n return this.fetchInstance.post(ApiEndpoints.EMAIL_VERIFICATIONS)\n }\n\n sendPhoneVerification = async () => {\n return this.fetchInstance.post(ApiEndpoints.PHONE_VERIFICATIONS + '/deliver')\n }\n\n verifyPhoneToken = async (sms_verification_token: string) => {\n return this.fetchInstance\n .post(ApiEndpoints.PHONE_VERIFICATIONS + '/verify', { sms_verification_token })\n .then((res) => ({ verified: res.verified }))\n }\n\n updateDevice = async (device: Device) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.DEVICES}/${device.guid}`, device)\n .then((data) => data.device)\n }\n\n updateNotificationProfile = async (notificationProfile: NotificationProfile) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.NOTIFICATION_PROFILES}/${notificationProfile.guid}`, notificationProfile)\n .then((data) => data.notification_profile)\n }\n\n updateUserCommunicationProfile = async (userCommunicationProfile: UserCommunicationProfile) => {\n return this.fetchInstance\n .put(ApiEndpoints.USER_COMMUNICATION_PROFILE, userCommunicationProfile)\n .then((data) => data.user_communication_profile)\n }\n\n getInsightsNotificationProfiles = async () => {\n return this.fetchInstance\n .get(`${ApiEndpoints.NOTIFICATION_PROFILES}/${ApiEndpoints.INSIGHTS_NOTIFICATION_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Aa,4BAA4B,CAAwB,EACrE,KAAA,CAAM,MAAS,EAAK,0BAA0B;AAAA,EAGnD,kCAAkC,YACzB,KAAK,cACT,IAAI,GAAG,EAAa,qBAAA,IAAyB,EAAa,8BAAA,EAAgC,EAC1F,KAAA,CAAM,MAAS,CAAI;AAE1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiEndpoints.es.js","names":[],"sources":["../../../src/core/constants/ApiEndpoints.ts"],"sourcesContent":["export const ApiEndpoints = {\n ACCOUNTS: 'accounts',\n ANALYTICS_EVENTS: 'analytics_events',\n ANALYTICS_FEATURE_VISITS: 'feature_visits',\n ANALYTICS_PAGEVIEWS: 'analytics_pageviews',\n ANALYTICS_SESSION: 'analytics_sessions',\n APP_DATA: 'raja/data?type=master',\n BEATS: 'beats',\n BUDGETS: 'budgets',\n CATEGORIES: 'categories',\n
|
|
1
|
+
{"version":3,"file":"ApiEndpoints.es.js","names":[],"sources":["../../../src/core/constants/ApiEndpoints.ts"],"sourcesContent":["export const ApiEndpoints = {\n ACCOUNTS: 'accounts',\n ANALYTICS_EVENTS: 'analytics_events',\n ANALYTICS_FEATURE_VISITS: 'feature_visits',\n ANALYTICS_PAGEVIEWS: 'analytics_pageviews',\n ANALYTICS_SESSION: 'analytics_sessions',\n APP_DATA: 'raja/data?type=master',\n BEATS: 'beats',\n BUDGETS: 'budgets',\n CATEGORIES: 'categories',\n DATE_RANGE_CATEGORY_TOTALS: 'date_range_category_totals',\n DEVICES: 'devices',\n EMAIL_VERIFICATIONS: 'email_verifications',\n GOALS: 'goals',\n HEALTH_SCORES: 'health_scores',\n HOLDINGS: 'holdings',\n INSTITUTIONS: 'institutions',\n INSIGHTS_NOTIFICATION_PROFILES: 'insight_notification_profiles',\n LOCALIZED_COPY: 'localized_copies',\n LOCALIZED_CONTENT: 'localized_content',\n MEMBERS: 'members',\n MERCHANTS: 'merchants',\n MERCHANT_BUDGETS: 'merchant_budgets',\n MONTHLY_CASH_FLOW_PROFILE: 'monthly_cash_flow_profile',\n MONTHLY_CATEGORY_TOTALS: 'monthly_category_totals',\n OFFERS: 'offers',\n NOTIFICATION_PROFILES: 'notification_profiles',\n NOTIFICATIONS: 'notifications',\n PHONE_VERIFICATIONS: 'sms_verification',\n PULSE_COMMUNICATIONS: 'pulse_communications',\n REPEATING_TRANSACTIONS: 'repeating_transactions',\n RETIREMENT_GOALS: 'retirement_goals',\n RETIREMENT_GOAL_ACCOUNTS: 'retirement_goal_accounts',\n SCHEDULED_PAYMENTS: 'scheduled_payments',\n SPENDING_PLANS: 'spending_plans',\n SUPPORT_TICKETS: 'support_tickets',\n TAGGINGS: 'taggings',\n TAGS: 'tags',\n TRANSACTION_RULES: 'transaction_rules',\n TRANSACTIONS: 'transactions',\n USER: 'user',\n USER_COMMUNICATION_PROFILE: 'user_communication_profile',\n USER_FEATURES: 'user_features',\n USER_PROFILES: 'user_profiles',\n WIDGET_URLS: 'widget_urls',\n}\n"],"mappings":"AAAA,IAAa,IAAe;AAAA,EAC1B,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,0BAA0B;AAAA,EAC1B,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,4BAA4B;AAAA,EAC5B,SAAS;AAAA,EACT,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,UAAU;AAAA,EACV,cAAc;AAAA,EACd,gCAAgC;AAAA,EAChC,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,yBAAyB;AAAA,EACzB,QAAQ;AAAA,EACR,uBAAuB;AAAA,EACvB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,0BAA0B;AAAA,EAC1B,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,MAAM;AAAA,EACN,4BAA4B;AAAA,EAC5B,eAAe;AAAA,EACf,eAAe;AAAA,EACf,aAAa;AACf"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CategoryGuidToName as C, CategoryGuids as n } from "../constants/Category.es.js";
|
|
2
2
|
import { CategoryApi as d } from "../api/CategoryApi.es.js";
|
|
3
3
|
import { augmentCategories as T, getDetailedCategoryTransactions as S } from "../utils/CategoryUtil.es.js";
|
|
4
|
+
import { toUnixUTC as l } from "../utils/DateUtil.es.js";
|
|
4
5
|
import { endOfMonth as c } from "date-fns/endOfMonth";
|
|
5
6
|
import { startOfMonth as m } from "date-fns/startOfMonth";
|
|
6
7
|
import { subMonths as h } from "date-fns/subMonths";
|
|
7
8
|
import { makeAutoObservable as u, runInAction as g } from "mobx";
|
|
8
|
-
import { getUnixTime as l } from "date-fns/getUnixTime";
|
|
9
9
|
var I = class {
|
|
10
10
|
globalStore;
|
|
11
11
|
uiStore;
|
|
@@ -21,8 +21,8 @@ var I = class {
|
|
|
21
21
|
monthlyTotalsLoading = !1;
|
|
22
22
|
dateRangeTotalsRequestId = 0;
|
|
23
23
|
monthlyTotalsRequestId = 0;
|
|
24
|
-
constructor(
|
|
25
|
-
this.globalStore =
|
|
24
|
+
constructor(t) {
|
|
25
|
+
this.globalStore = t, this.uiStore = new p(), this.api = new d(t.endpoint, t.sessionToken, t.onError), u(this, {
|
|
26
26
|
dateRangeTotalsRequestId: !1,
|
|
27
27
|
monthlyTotalsRequestId: !1
|
|
28
28
|
});
|
|
@@ -34,30 +34,30 @@ var I = class {
|
|
|
34
34
|
return S(this.detailedCategories, this.globalStore.transactionStore.sortedTransactions);
|
|
35
35
|
}
|
|
36
36
|
get incomeCategories() {
|
|
37
|
-
return this.detailedCategories.filter((
|
|
37
|
+
return this.detailedCategories.filter((t) => t.is_income);
|
|
38
38
|
}
|
|
39
39
|
get spendCategories() {
|
|
40
|
-
return this.detailedCategories.filter((
|
|
40
|
+
return this.detailedCategories.filter((t) => !t.is_income && !t.isTransfer && t.guid !== n.INVESTMENTS);
|
|
41
41
|
}
|
|
42
42
|
get transferCategories() {
|
|
43
|
-
return this.detailedCategories.filter((
|
|
43
|
+
return this.detailedCategories.filter((t) => t.isTransfer);
|
|
44
44
|
}
|
|
45
|
-
setCategories = (
|
|
46
|
-
this.categories =
|
|
45
|
+
setCategories = (t) => {
|
|
46
|
+
this.categories = t, this.categoriesLoading = !1, this.categoriesLoaded = !0;
|
|
47
47
|
};
|
|
48
|
-
setMonthlyCategoryTotals = (
|
|
49
|
-
this.monthlyCategoryTotals =
|
|
48
|
+
setMonthlyCategoryTotals = (t) => {
|
|
49
|
+
this.monthlyCategoryTotals = t, this.monthlyTotalsLoading = !1, this.monthlyTotalsLoaded = !0;
|
|
50
50
|
};
|
|
51
|
-
setDateRangeCategoryTotals = (
|
|
52
|
-
this.dateRangeCategoryTotals =
|
|
51
|
+
setDateRangeCategoryTotals = (t) => {
|
|
52
|
+
this.dateRangeCategoryTotals = t, this.dateRangeTotalsLoading = !1, this.dateRangeTotalsLoaded = !0;
|
|
53
53
|
};
|
|
54
54
|
get trendsCategories() {
|
|
55
|
-
return this.detailedCategories.filter((
|
|
55
|
+
return this.detailedCategories.filter((t) => t.totalAmount !== 0).filter((t) => t.guid !== n.INVESTMENTS && t.guid !== n.TRANSFER);
|
|
56
56
|
}
|
|
57
|
-
addCategory = async (
|
|
57
|
+
addCategory = async (t, e) => {
|
|
58
58
|
const r = {
|
|
59
|
-
name:
|
|
60
|
-
parent_guid:
|
|
59
|
+
name: t,
|
|
60
|
+
parent_guid: e
|
|
61
61
|
};
|
|
62
62
|
try {
|
|
63
63
|
await this.api.addCategory(r), await this.loadCategories();
|
|
@@ -69,22 +69,22 @@ var I = class {
|
|
|
69
69
|
if (!this.categoriesLoading) {
|
|
70
70
|
this.categoriesLoading = !0;
|
|
71
71
|
try {
|
|
72
|
-
const
|
|
73
|
-
this.setCategories(
|
|
74
|
-
} catch (
|
|
75
|
-
console.error("Error occurred while getting categories:",
|
|
72
|
+
const t = await this.api.getCategories();
|
|
73
|
+
this.setCategories(t);
|
|
74
|
+
} catch (t) {
|
|
75
|
+
console.error("Error occurred while getting categories:", t), this.globalStore.captureException(t, { store: "CategoryStore" }), g(() => {
|
|
76
76
|
this.categoriesLoading = !1;
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
loadDateRangeCategoryTotals = async (
|
|
81
|
+
loadDateRangeCategoryTotals = async (t, e, r) => {
|
|
82
82
|
const a = ++this.dateRangeTotalsRequestId, o = () => a !== this.dateRangeTotalsRequestId;
|
|
83
83
|
g(() => {
|
|
84
84
|
this.dateRangeTotalsLoading = !0;
|
|
85
85
|
});
|
|
86
86
|
try {
|
|
87
|
-
const s = await this.api.getDateRangeCategoryTotals(l(
|
|
87
|
+
const s = await this.api.getDateRangeCategoryTotals(l(e), l(r), t);
|
|
88
88
|
if (o()) return;
|
|
89
89
|
this.setDateRangeCategoryTotals(s);
|
|
90
90
|
} catch (s) {
|
|
@@ -92,14 +92,14 @@ var I = class {
|
|
|
92
92
|
console.error("Error occurred while getting date range category totals:", s), this.globalStore.captureException(s, { store: "CategoryStore" }), this.setDateRangeCategoryTotals([]);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
loadMonthlyCategoryTotals = async (
|
|
95
|
+
loadMonthlyCategoryTotals = async (t = this.globalStore.globalUiStore.selectedAccounts, e, r) => {
|
|
96
96
|
const a = ++this.monthlyTotalsRequestId, o = () => a !== this.monthlyTotalsRequestId;
|
|
97
97
|
g(() => {
|
|
98
98
|
this.monthlyTotalsLoading = !0;
|
|
99
99
|
});
|
|
100
|
-
const s = l(m(
|
|
100
|
+
const s = l(m(e ?? h(/* @__PURE__ */ new Date(), 11))), y = l(c(r ?? /* @__PURE__ */ new Date()));
|
|
101
101
|
try {
|
|
102
|
-
const i = await this.api.getMonthlyCategoryTotals(s, y,
|
|
102
|
+
const i = await this.api.getMonthlyCategoryTotals(s, y, t);
|
|
103
103
|
if (o()) return;
|
|
104
104
|
this.setMonthlyCategoryTotals(i);
|
|
105
105
|
} catch (i) {
|
|
@@ -107,25 +107,25 @@ var I = class {
|
|
|
107
107
|
console.error("Error occurred while getting monthly category totals:", i), this.globalStore.captureException(i, { store: "CategoryStore" }), this.setMonthlyCategoryTotals([]);
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
reloadCategoryTotals = async (
|
|
111
|
-
const a =
|
|
112
|
-
await Promise.all([this.loadMonthlyCategoryTotals(
|
|
110
|
+
reloadCategoryTotals = async (t, e, r) => {
|
|
111
|
+
const a = e ?? h(/* @__PURE__ */ new Date(), 11), o = r ?? c(/* @__PURE__ */ new Date());
|
|
112
|
+
await Promise.all([this.loadMonthlyCategoryTotals(t, a, o), this.loadDateRangeCategoryTotals(t, a, o)]);
|
|
113
113
|
};
|
|
114
|
-
removeCategory = async (
|
|
114
|
+
removeCategory = async (t) => {
|
|
115
115
|
try {
|
|
116
|
-
await this.api.removeCategory(
|
|
117
|
-
} catch (
|
|
118
|
-
console.error("Error occurred while removing category:",
|
|
116
|
+
await this.api.removeCategory(t), await this.loadCategories();
|
|
117
|
+
} catch (e) {
|
|
118
|
+
console.error("Error occurred while removing category:", e), this.globalStore.captureException(e, { store: "CategoryStore" });
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
updateCategory = async (
|
|
121
|
+
updateCategory = async (t) => {
|
|
122
122
|
try {
|
|
123
|
-
await this.api.updateCategory(
|
|
124
|
-
} catch (
|
|
125
|
-
console.error("Error occurred while updating category:",
|
|
123
|
+
await this.api.updateCategory(t), await this.loadCategories();
|
|
124
|
+
} catch (e) {
|
|
125
|
+
console.error("Error occurred while updating category:", e), this.globalStore.captureException(e, { store: "CategoryStore" });
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
getCategoryName = (
|
|
128
|
+
getCategoryName = (t) => this.categories.find((e) => e.guid === t)?.name ?? C[t];
|
|
129
129
|
}, p = class {
|
|
130
130
|
expandedGuid = null;
|
|
131
131
|
selectedGuid = null;
|
|
@@ -138,15 +138,15 @@ var I = class {
|
|
|
138
138
|
constructor() {
|
|
139
139
|
u(this);
|
|
140
140
|
}
|
|
141
|
-
setExpandedGuid = (
|
|
142
|
-
setSelectedGuid = (
|
|
143
|
-
setSearchValue = (
|
|
144
|
-
setShouldDisableDrawerScroll = (
|
|
145
|
-
setShowSelected = (
|
|
146
|
-
setUnselectable = (
|
|
147
|
-
setUnselectableText = (
|
|
148
|
-
onSelect = (
|
|
149
|
-
setOnSelect = (
|
|
141
|
+
setExpandedGuid = (t) => this.expandedGuid = t;
|
|
142
|
+
setSelectedGuid = (t) => this.selectedGuid = t;
|
|
143
|
+
setSearchValue = (t) => this.searchValue = t;
|
|
144
|
+
setShouldDisableDrawerScroll = (t) => this.shouldDisableDrawerScroll = t;
|
|
145
|
+
setShowSelected = (t) => this.showSelected = t;
|
|
146
|
+
setUnselectable = (t) => this.unselectable = t;
|
|
147
|
+
setUnselectableText = (t) => this.unselectableText = t;
|
|
148
|
+
onSelect = (t) => this.savedOnSelect(t);
|
|
149
|
+
setOnSelect = (t) => this.savedOnSelect = t;
|
|
150
150
|
};
|
|
151
151
|
export {
|
|
152
152
|
I as CategoryStore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryStore.es.js","names":[],"sources":["../../../src/core/stores/CategoryStore.ts"],"sourcesContent":["import { makeAutoObservable, runInAction } from 'mobx'\nimport { getUnixTime } from 'date-fns/getUnixTime'\nimport { subMonths } from 'date-fns/subMonths'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { endOfMonth } from 'date-fns/endOfMonth'\n\nimport { CategoryGuids, CategoryGuidToName } from '../constants'\nimport { CategoryApi } from '../api'\n\nimport { GlobalStore } from './GlobalStore'\n\nimport type {\n Account,\n Category,\n DetailedCategory,\n DetailedCategoryWithTransactions,\n DateRangeCategoryTotals,\n MonthlyCategoryTotals,\n} from '../types'\n\nimport { augmentCategories, getDetailedCategoryTransactions } from '../utils/CategoryUtil'\n\nexport class CategoryStore {\n globalStore: GlobalStore\n uiStore: UiStore\n api = new CategoryApi('/', '')\n\n categories: Category[] = []\n categoriesLoaded: boolean = false\n categoriesLoading: boolean = false\n dateRangeCategoryTotals: DateRangeCategoryTotals[] = []\n monthlyCategoryTotals: MonthlyCategoryTotals[] = []\n\n dateRangeTotalsLoaded = false\n dateRangeTotalsLoading = false\n monthlyTotalsLoaded = false\n monthlyTotalsLoading = false\n\n // Monotonic request tokens, one per totals endpoint. A newer request\n // supersedes an older in-flight one: the stale response is discarded rather\n // than the newer request being dropped. These loaders used to early-return\n // while a request was in flight, which silently swallowed date-range/account\n // changes made mid-flight. (MEW-3910)\n //\n // Deliberately per-endpoint rather than one shared counter: several callers\n // (BubbleBudgetsWidget, BubbleBudgetsMiniWidget) fire the two loaders\n // independently and concurrently, and a shared counter would make the second\n // call supersede — and silently drop — the first.\n //\n // Kept out of the observable graph — internal concurrency bookkeeping, not\n // renderable state.\n dateRangeTotalsRequestId = 0\n monthlyTotalsRequestId = 0\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.uiStore = new UiStore()\n this.api = new CategoryApi(globalStore.endpoint, globalStore.sessionToken, globalStore.onError)\n\n makeAutoObservable(this, {\n dateRangeTotalsRequestId: false,\n monthlyTotalsRequestId: false,\n })\n }\n\n get detailedCategories(): DetailedCategory[] {\n if (!this.globalStore.isInitialized) return []\n return augmentCategories(\n this.categories,\n this.globalStore.copyStore.copy.categories,\n this.dateRangeCategoryTotals,\n this.monthlyCategoryTotals,\n )\n }\n\n get detailedCategoriesWithTransactions(): DetailedCategoryWithTransactions[] {\n return getDetailedCategoryTransactions(\n this.detailedCategories,\n this.globalStore.transactionStore.sortedTransactions,\n )\n }\n\n get incomeCategories(): DetailedCategory[] {\n return this.detailedCategories.filter((c) => c.is_income)\n }\n\n get spendCategories(): DetailedCategory[] {\n return this.detailedCategories.filter(\n (c) => !c.is_income && !c.isTransfer && c.guid !== CategoryGuids.INVESTMENTS,\n )\n }\n\n get transferCategories(): DetailedCategory[] {\n return this.detailedCategories.filter((c) => c.isTransfer)\n }\n\n setCategories = (categories: Category[]) => {\n this.categories = categories\n this.categoriesLoading = false\n this.categoriesLoaded = true\n }\n\n setMonthlyCategoryTotals = (totals: MonthlyCategoryTotals[]) => {\n this.monthlyCategoryTotals = totals\n this.monthlyTotalsLoading = false\n this.monthlyTotalsLoaded = true\n }\n\n setDateRangeCategoryTotals = (totals: DateRangeCategoryTotals[]) => {\n this.dateRangeCategoryTotals = totals\n this.dateRangeTotalsLoading = false\n this.dateRangeTotalsLoaded = true\n }\n\n get trendsCategories(): DetailedCategory[] {\n return this.detailedCategories\n .filter((c) => c.totalAmount !== 0)\n .filter((c) => c.guid !== CategoryGuids.INVESTMENTS && c.guid !== CategoryGuids.TRANSFER)\n }\n\n addCategory = async (name: string, parentGuid: string) => {\n const category = { name, parent_guid: parentGuid } as Category\n\n try {\n await this.api.addCategory(category)\n await this.loadCategories()\n } catch (error) {\n console.error('Error occurred while adding category:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n }\n }\n\n loadCategories = async () => {\n if (this.categoriesLoading) return\n\n this.categoriesLoading = true\n try {\n const categories = await this.api.getCategories()\n this.setCategories(categories)\n } catch (error) {\n console.error('Error occurred while getting categories:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n runInAction(() => {\n this.categoriesLoading = false\n })\n }\n }\n\n loadDateRangeCategoryTotals = async (accounts: Account[], startDate: Date, endDate: Date) => {\n // Claim this request. Any request started later wins, so a date-range or\n // account change made while a request is in flight is no longer dropped.\n const requestId = ++this.dateRangeTotalsRequestId\n const isStale = () => requestId !== this.dateRangeTotalsRequestId\n\n runInAction(() => {\n this.dateRangeTotalsLoading = true\n })\n\n try {\n const totals = await this.api.getDateRangeCategoryTotals(\n getUnixTime(startDate),\n getUnixTime(endDate),\n accounts,\n )\n // A newer request superseded this one; its response is authoritative.\n // Leave the loading flag alone: the newest request still owns it.\n if (isStale()) return\n this.setDateRangeCategoryTotals(totals)\n } catch (error) {\n // Don't report deliberately superseded requests — rapid date scrubbing\n // would otherwise spam the error backend. (MEW-3910)\n if (isStale()) return\n console.error('Error occurred while getting date range category totals:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n this.setDateRangeCategoryTotals([])\n }\n }\n\n loadMonthlyCategoryTotals = async (\n accounts: Account[] = this.globalStore.globalUiStore.selectedAccounts,\n startDate?: Date,\n endDate?: Date,\n ) => {\n // See loadDateRangeCategoryTotals: newest request wins. (MEW-3910)\n const requestId = ++this.monthlyTotalsRequestId\n const isStale = () => requestId !== this.monthlyTotalsRequestId\n runInAction(() => {\n this.monthlyTotalsLoading = true\n })\n\n const start = getUnixTime(startOfMonth(startDate ?? subMonths(new Date(), 11)))\n const end = getUnixTime(endOfMonth(endDate ?? new Date()))\n\n try {\n const totals = await this.api.getMonthlyCategoryTotals(start, end, accounts)\n if (isStale()) return\n this.setMonthlyCategoryTotals(totals)\n } catch (error) {\n // Superseded requests are not reported. (MEW-3910)\n if (isStale()) return\n console.error('Error occurred while getting monthly category totals:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n // Setter clears monthlyTotalsLoading and marks loaded so the UI recovers\n // and retries aren't blocked. (MEW-3538)\n this.setMonthlyCategoryTotals([])\n }\n }\n\n reloadCategoryTotals = async (accounts: Account[], startDate?: Date, endDate?: Date) => {\n const start = startDate ?? subMonths(new Date(), 11)\n const end = endDate ?? endOfMonth(new Date())\n // Each loader claims its own token, so the pair does not invalidate itself.\n // No try/catch: both loaders handle and report their own errors and always\n // resolve, so nothing can reject here.\n await Promise.all([\n this.loadMonthlyCategoryTotals(accounts, start, end),\n this.loadDateRangeCategoryTotals(accounts, start, end),\n ])\n }\n\n removeCategory = async (guid: string) => {\n try {\n await this.api.removeCategory(guid)\n await this.loadCategories()\n } catch (error) {\n console.error('Error occurred while removing category:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n }\n }\n\n updateCategory = async (category: Category) => {\n try {\n await this.api.updateCategory(category)\n await this.loadCategories()\n } catch (error) {\n console.error('Error occurred while updating category:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n }\n }\n\n // TODO: Remove this after refactoring Trends components to use detailedCategories\n getCategoryName = (guid: string) => {\n const category = this.categories.find((c) => c.guid === guid)\n return category?.name ?? CategoryGuidToName[guid]\n }\n}\n\n// TODO: Move into CategoryStore\nclass UiStore {\n expandedGuid: string | null = null\n selectedGuid: string | null = null\n searchValue = ''\n showSelected = true\n shouldDisableDrawerScroll = false\n unselectable: string[] = []\n unselectableText = ''\n\n savedOnSelect: any // todo\n\n constructor() {\n makeAutoObservable(this)\n }\n\n setExpandedGuid = (guid: string | null) => (this.expandedGuid = guid)\n\n setSelectedGuid = (guid: string | null) => (this.selectedGuid = guid)\n\n setSearchValue = (value: string) => (this.searchValue = value)\n\n setShouldDisableDrawerScroll = (shouldDisable: boolean) =>\n (this.shouldDisableDrawerScroll = shouldDisable)\n\n setShowSelected = (showSelected: boolean) => (this.showSelected = showSelected)\n\n setUnselectable = (unselectable: string[]) => (this.unselectable = unselectable)\n\n setUnselectableText = (text: string) => (this.unselectableText = text)\n\n onSelect = (guid: string) => this.savedOnSelect(guid)\n\n setOnSelect = (callback: any) => (this.savedOnSelect = callback)\n}\n"],"mappings":";;;;;;;;AAsBA,IAAa,IAAb,MAA2B;AAAA,EACzB;AAAA,EACA;AAAA,EACA,MAAM,IAAI,EAAY,KAAK,EAAE;AAAA,EAE7B,aAAyB,CAAC;AAAA,EAC1B,mBAA4B;AAAA,EAC5B,oBAA6B;AAAA,EAC7B,0BAAqD,CAAC;AAAA,EACtD,wBAAiD,CAAC;AAAA,EAElD,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makeAutoObservable, runInAction } from 'mobx'\nimport { subMonths } from 'date-fns/subMonths'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { endOfMonth } from 'date-fns/endOfMonth'\n\nimport { CategoryGuids, CategoryGuidToName } from '../constants'\nimport { CategoryApi } from '../api'\nimport { toUnixUTC } from '../utils/DateUtil'\n\nimport { GlobalStore } from './GlobalStore'\n\nimport type {\n Account,\n Category,\n DetailedCategory,\n DetailedCategoryWithTransactions,\n DateRangeCategoryTotals,\n MonthlyCategoryTotals,\n} from '../types'\n\nimport { augmentCategories, getDetailedCategoryTransactions } from '../utils/CategoryUtil'\n\nexport class CategoryStore {\n globalStore: GlobalStore\n uiStore: UiStore\n api = new CategoryApi('/', '')\n\n categories: Category[] = []\n categoriesLoaded: boolean = false\n categoriesLoading: boolean = false\n dateRangeCategoryTotals: DateRangeCategoryTotals[] = []\n monthlyCategoryTotals: MonthlyCategoryTotals[] = []\n\n dateRangeTotalsLoaded = false\n dateRangeTotalsLoading = false\n monthlyTotalsLoaded = false\n monthlyTotalsLoading = false\n\n // Monotonic request tokens, one per totals endpoint. A newer request\n // supersedes an older in-flight one: the stale response is discarded rather\n // than the newer request being dropped. These loaders used to early-return\n // while a request was in flight, which silently swallowed date-range/account\n // changes made mid-flight. (MEW-3910)\n //\n // Deliberately per-endpoint rather than one shared counter: several callers\n // (BubbleBudgetsWidget, BubbleBudgetsMiniWidget) fire the two loaders\n // independently and concurrently, and a shared counter would make the second\n // call supersede — and silently drop — the first.\n //\n // Kept out of the observable graph — internal concurrency bookkeeping, not\n // renderable state.\n dateRangeTotalsRequestId = 0\n monthlyTotalsRequestId = 0\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.uiStore = new UiStore()\n this.api = new CategoryApi(globalStore.endpoint, globalStore.sessionToken, globalStore.onError)\n\n makeAutoObservable(this, {\n dateRangeTotalsRequestId: false,\n monthlyTotalsRequestId: false,\n })\n }\n\n get detailedCategories(): DetailedCategory[] {\n if (!this.globalStore.isInitialized) return []\n return augmentCategories(\n this.categories,\n this.globalStore.copyStore.copy.categories,\n this.dateRangeCategoryTotals,\n this.monthlyCategoryTotals,\n )\n }\n\n get detailedCategoriesWithTransactions(): DetailedCategoryWithTransactions[] {\n return getDetailedCategoryTransactions(\n this.detailedCategories,\n this.globalStore.transactionStore.sortedTransactions,\n )\n }\n\n get incomeCategories(): DetailedCategory[] {\n return this.detailedCategories.filter((c) => c.is_income)\n }\n\n get spendCategories(): DetailedCategory[] {\n return this.detailedCategories.filter(\n (c) => !c.is_income && !c.isTransfer && c.guid !== CategoryGuids.INVESTMENTS,\n )\n }\n\n get transferCategories(): DetailedCategory[] {\n return this.detailedCategories.filter((c) => c.isTransfer)\n }\n\n setCategories = (categories: Category[]) => {\n this.categories = categories\n this.categoriesLoading = false\n this.categoriesLoaded = true\n }\n\n setMonthlyCategoryTotals = (totals: MonthlyCategoryTotals[]) => {\n this.monthlyCategoryTotals = totals\n this.monthlyTotalsLoading = false\n this.monthlyTotalsLoaded = true\n }\n\n setDateRangeCategoryTotals = (totals: DateRangeCategoryTotals[]) => {\n this.dateRangeCategoryTotals = totals\n this.dateRangeTotalsLoading = false\n this.dateRangeTotalsLoaded = true\n }\n\n get trendsCategories(): DetailedCategory[] {\n return this.detailedCategories\n .filter((c) => c.totalAmount !== 0)\n .filter((c) => c.guid !== CategoryGuids.INVESTMENTS && c.guid !== CategoryGuids.TRANSFER)\n }\n\n addCategory = async (name: string, parentGuid: string) => {\n const category = { name, parent_guid: parentGuid } as Category\n\n try {\n await this.api.addCategory(category)\n await this.loadCategories()\n } catch (error) {\n console.error('Error occurred while adding category:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n }\n }\n\n loadCategories = async () => {\n if (this.categoriesLoading) return\n\n this.categoriesLoading = true\n try {\n const categories = await this.api.getCategories()\n this.setCategories(categories)\n } catch (error) {\n console.error('Error occurred while getting categories:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n runInAction(() => {\n this.categoriesLoading = false\n })\n }\n }\n\n loadDateRangeCategoryTotals = async (accounts: Account[], startDate: Date, endDate: Date) => {\n // Claim this request. Any request started later wins, so a date-range or\n // account change made while a request is in flight is no longer dropped.\n const requestId = ++this.dateRangeTotalsRequestId\n const isStale = () => requestId !== this.dateRangeTotalsRequestId\n\n runInAction(() => {\n this.dateRangeTotalsLoading = true\n })\n\n try {\n // UTC-midnight boundaries so the window matches the absolute post dates the\n // API keys on; local Dates would shift it by the viewer's timezone offset.\n const totals = await this.api.getDateRangeCategoryTotals(\n toUnixUTC(startDate),\n toUnixUTC(endDate),\n accounts,\n )\n // A newer request superseded this one; its response is authoritative.\n // Leave the loading flag alone: the newest request still owns it.\n if (isStale()) return\n this.setDateRangeCategoryTotals(totals)\n } catch (error) {\n // Don't report deliberately superseded requests — rapid date scrubbing\n // would otherwise spam the error backend. (MEW-3910)\n if (isStale()) return\n console.error('Error occurred while getting date range category totals:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n this.setDateRangeCategoryTotals([])\n }\n }\n\n loadMonthlyCategoryTotals = async (\n accounts: Account[] = this.globalStore.globalUiStore.selectedAccounts,\n startDate?: Date,\n endDate?: Date,\n ) => {\n // See loadDateRangeCategoryTotals: newest request wins. (MEW-3910)\n const requestId = ++this.monthlyTotalsRequestId\n const isStale = () => requestId !== this.monthlyTotalsRequestId\n runInAction(() => {\n this.monthlyTotalsLoading = true\n })\n\n // UTC-midnight boundaries; see loadDateRangeCategoryTotals.\n const start = toUnixUTC(startOfMonth(startDate ?? subMonths(new Date(), 11)))\n const end = toUnixUTC(endOfMonth(endDate ?? new Date()))\n\n try {\n const totals = await this.api.getMonthlyCategoryTotals(start, end, accounts)\n if (isStale()) return\n this.setMonthlyCategoryTotals(totals)\n } catch (error) {\n // Superseded requests are not reported. (MEW-3910)\n if (isStale()) return\n console.error('Error occurred while getting monthly category totals:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n // Setter clears monthlyTotalsLoading and marks loaded so the UI recovers\n // and retries aren't blocked. (MEW-3538)\n this.setMonthlyCategoryTotals([])\n }\n }\n\n reloadCategoryTotals = async (accounts: Account[], startDate?: Date, endDate?: Date) => {\n const start = startDate ?? subMonths(new Date(), 11)\n const end = endDate ?? endOfMonth(new Date())\n // Each loader claims its own token, so the pair does not invalidate itself.\n // No try/catch: both loaders handle and report their own errors and always\n // resolve, so nothing can reject here.\n await Promise.all([\n this.loadMonthlyCategoryTotals(accounts, start, end),\n this.loadDateRangeCategoryTotals(accounts, start, end),\n ])\n }\n\n removeCategory = async (guid: string) => {\n try {\n await this.api.removeCategory(guid)\n await this.loadCategories()\n } catch (error) {\n console.error('Error occurred while removing category:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n }\n }\n\n updateCategory = async (category: Category) => {\n try {\n await this.api.updateCategory(category)\n await this.loadCategories()\n } catch (error) {\n console.error('Error occurred while updating category:', error)\n this.globalStore.captureException(error, { store: 'CategoryStore' })\n }\n }\n\n // TODO: Remove this after refactoring Trends components to use detailedCategories\n getCategoryName = (guid: string) => {\n const category = this.categories.find((c) => c.guid === guid)\n return category?.name ?? CategoryGuidToName[guid]\n }\n}\n\n// TODO: Move into CategoryStore\nclass UiStore {\n expandedGuid: string | null = null\n selectedGuid: string | null = null\n searchValue = ''\n showSelected = true\n shouldDisableDrawerScroll = false\n unselectable: string[] = []\n unselectableText = ''\n\n savedOnSelect: any // todo\n\n constructor() {\n makeAutoObservable(this)\n }\n\n setExpandedGuid = (guid: string | null) => (this.expandedGuid = guid)\n\n setSelectedGuid = (guid: string | null) => (this.selectedGuid = guid)\n\n setSearchValue = (value: string) => (this.searchValue = value)\n\n setShouldDisableDrawerScroll = (shouldDisable: boolean) =>\n (this.shouldDisableDrawerScroll = shouldDisable)\n\n setShowSelected = (showSelected: boolean) => (this.showSelected = showSelected)\n\n setUnselectable = (unselectable: string[]) => (this.unselectable = unselectable)\n\n setUnselectableText = (text: string) => (this.unselectableText = text)\n\n onSelect = (guid: string) => this.savedOnS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AAK,eAAe;AAAA,EAElE,kBAAA,CAAmB,MAA4B,KAAK,eAAe;AAAA,EAEnE,sBAAA,CAAuB,MAAkB,KAAK,mBAAmB;AAAA,EAEjE,WAAA,CAAY,MAAiB,KAAK,cAAc,CAAI;AAAA,EAEpD,cAAA,CAAe,MAAmB,KAAK,gBAAgB;AACzD"}
|
|
@@ -3,8 +3,8 @@ import { augmentChartData as s, augmentSpendingFeeTransactions as i } from "../u
|
|
|
3
3
|
import { format as c } from "date-fns/format";
|
|
4
4
|
import { subMonths as h } from "date-fns/subMonths";
|
|
5
5
|
import { makeAutoObservable as l, runInAction as r } from "mobx";
|
|
6
|
-
import { getUnixTime as n } from "date-fns/getUnixTime";
|
|
7
6
|
import { fromUnixTime as g } from "date-fns/fromUnixTime";
|
|
7
|
+
import { getUnixTime as n } from "date-fns/getUnixTime";
|
|
8
8
|
var b = class {
|
|
9
9
|
api = new o("/", "");
|
|
10
10
|
augmentedChartData = [];
|
|
@@ -38,10 +38,6 @@ export declare class SettingsStore {
|
|
|
38
38
|
severity: import('@mui/types').OverridableStringUnion<import('@mui/material').AlertColor, import('@mui/material').AlertPropsColorOverrides> | undefined;
|
|
39
39
|
};
|
|
40
40
|
setSelectedRule: (rule?: TransactionRule) => void;
|
|
41
|
-
updatePassword: (params: {
|
|
42
|
-
new_password: string;
|
|
43
|
-
new_password_again: string;
|
|
44
|
-
}) => Promise<void>;
|
|
45
41
|
updateDevice: (device: Device) => Promise<{
|
|
46
42
|
success: boolean;
|
|
47
43
|
}>;
|