mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-21 06:58:47 -05:00
[AI] lint: await-thenable, no-floating-promises (#6987)
* [AI] Desktop client, E2E, loot-core, sync-server and tooling updates Co-authored-by: Cursor <cursoragent@cursor.com> * Refactor database handling in various modules to use async/await for improved readability and error handling. This includes updates to database opening and closing methods across multiple files, ensuring consistent asynchronous behavior. Additionally, minor adjustments were made to encryption functions to support async operations. * Refactor sync migration tests to utilize async/await for improved readability. Updated transaction handling to streamline event expectations and cleanup process. * Refactor various functions to utilize async/await for improved readability and error handling. Updated service stopping, encryption, and file upload/download methods to ensure consistent asynchronous behavior across the application. * Refactor BudgetFileSelection component to use async/await for onSelect method, enhancing error handling and readability. Update merge tests to utilize async/await for improved clarity in transaction merging expectations. * Refactor filesystem module to use async/await for init function and related database operations, enhancing error handling and consistency across file interactions. Updated tests to reflect asynchronous behavior in database operations and file writing. * Fix typo in init function declaration to ensure it returns a Promise<void> instead of Proise<void>. * Update VRT screenshots Auto-generated by VRT workflow PR: #6987 * Update tests to use async/await for init function in web filesystem, ensuring consistent asynchronous behavior in database operations. * Update VRT screenshot for payees filter test to reflect recent changes * [AI] Fix no-floating-promises lint error in desktop-electron Wrapped queuedClientWinLogs.map() with Promise.all and void operator to properly handle the array of promises for executing queued logs. Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com> * Refactor promise handling in global and sync event handlers * Update VRT screenshots Auto-generated by VRT workflow PR: #6987 --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a38104244a
commit
0472211925
@@ -74,4 +74,4 @@ async function checkReleaseNotesExists() {
|
||||
}
|
||||
}
|
||||
|
||||
checkReleaseNotesExists();
|
||||
void checkReleaseNotesExists();
|
||||
|
||||
@@ -74,4 +74,4 @@ async function commentOnPR() {
|
||||
}
|
||||
}
|
||||
|
||||
commentOnPR();
|
||||
void commentOnPR();
|
||||
|
||||
@@ -94,4 +94,4 @@ ${summaryData.summary}
|
||||
}
|
||||
}
|
||||
|
||||
createReleaseNotesFile();
|
||||
void createReleaseNotesFile();
|
||||
|
||||
2
.github/scripts/count-points.mjs
vendored
2
.github/scripts/count-points.mjs
vendored
@@ -96,7 +96,7 @@ async function getLastCommitBeforeDate(octokit, owner, repo, beforeDate) {
|
||||
* @param {string} repo - Repository name.
|
||||
* @param {number} prNumber - PR number.
|
||||
* @param {Date} monthEnd - The end date of the month to use as base revision.
|
||||
* @returns {Object} Object with category and points, or null if error.
|
||||
* @returns {Promise<Object>} Object with category and points, or null if error.
|
||||
*/
|
||||
async function getPRCategoryAndPoints(
|
||||
octokit,
|
||||
|
||||
@@ -101,6 +101,8 @@
|
||||
"typescript/no-var-requires": "error",
|
||||
// we want to allow unions such as "{ name: DbAccount['name'] | DbPayee['name'] }"
|
||||
"typescript/no-duplicate-type-constituents": "off",
|
||||
"typescript/await-thenable": "error",
|
||||
"typescript/no-floating-promises": "warn", // TODO: covert to error
|
||||
|
||||
// Import rules
|
||||
"import/consistent-type-specifier-style": "error",
|
||||
|
||||
@@ -178,4 +178,4 @@ async function execAsync(cmd: string, errorLog?: string): Promise<string> {
|
||||
});
|
||||
}
|
||||
|
||||
run();
|
||||
void run();
|
||||
|
||||
@@ -46,7 +46,7 @@ test.describe('Mobile Accounts', () => {
|
||||
|
||||
await expect(accountPage.heading).toHaveText('Bank of America');
|
||||
await expect(accountPage.transactionList).toBeVisible();
|
||||
await expect(await accountPage.getBalance()).toBeGreaterThan(0);
|
||||
expect(await accountPage.getBalance()).toBeGreaterThan(0);
|
||||
await expect(accountPage.noTransactionsMessage).not.toBeVisible();
|
||||
await expect(page).toMatchThemeScreenshots();
|
||||
|
||||
|
||||
@@ -158,9 +158,7 @@ test.describe('Accounts', () => {
|
||||
await expect(page).toMatchThemeScreenshots();
|
||||
|
||||
await expect(importButton).toBeDisabled();
|
||||
await expect(await importButton.innerText()).toMatch(
|
||||
/Import 0 transactions/,
|
||||
);
|
||||
expect(await importButton.innerText()).toMatch(/Import 0 transactions/);
|
||||
|
||||
await accountPage.page.getByRole('button', { name: 'Close' }).click();
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ export class MobileAccountPage {
|
||||
* Go to transaction creation page
|
||||
*/
|
||||
async clickCreateTransaction() {
|
||||
this.createTransactionButton.click();
|
||||
await this.createTransactionButton.click();
|
||||
return new MobileTransactionEntryPage(this.page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ export class MobileBudgetPage {
|
||||
return groupNameText;
|
||||
}
|
||||
|
||||
#getButtonForCategoryGroup(categoryGroupName: string | RegExp) {
|
||||
async #getButtonForCategoryGroup(categoryGroupName: string | RegExp) {
|
||||
return this.categoryGroupRows.getByRole('button', {
|
||||
name: categoryGroupName,
|
||||
exact: true,
|
||||
@@ -169,7 +169,7 @@ export class MobileBudgetPage {
|
||||
return categoryNameText;
|
||||
}
|
||||
|
||||
#getButtonForCategory(categoryName: string | RegExp) {
|
||||
async #getButtonForCategory(categoryName: string | RegExp) {
|
||||
return this.categoryRows.getByRole('button', {
|
||||
name: categoryName,
|
||||
exact: true,
|
||||
|
||||
@@ -36,9 +36,7 @@ test.describe('Mobile Settings', () => {
|
||||
|
||||
const download = await downloadPromise;
|
||||
|
||||
expect(await download.suggestedFilename()).toMatch(
|
||||
/^\d{4}-\d{2}-\d{2}-.*.zip$/,
|
||||
);
|
||||
expect(download.suggestedFilename()).toMatch(/^\d{4}-\d{2}-\d{2}-.*.zip$/);
|
||||
await expect(page).toMatchThemeScreenshots();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,8 +37,6 @@ test.describe('Settings', () => {
|
||||
|
||||
const download = await downloadPromise;
|
||||
|
||||
expect(await download.suggestedFilename()).toMatch(
|
||||
/^\d{4}-\d{2}-\d{2}-.*.zip$/,
|
||||
);
|
||||
expect(download.suggestedFilename()).toMatch(/^\d{4}-\d{2}-\d{2}-.*.zip$/);
|
||||
});
|
||||
});
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
@@ -32,7 +32,7 @@ import type { AppDispatch } from '@desktop-client/redux/store';
|
||||
import { setNewTransactions } from '@desktop-client/transactions/transactionsSlice';
|
||||
|
||||
const invalidateQueries = (queryClient: QueryClient, queryKey?: QueryKey) => {
|
||||
queryClient.invalidateQueries({
|
||||
void queryClient.invalidateQueries({
|
||||
queryKey: queryKey ?? accountQueries.lists(),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ export const resetSync = createAppAsyncThunk(
|
||||
options: {
|
||||
onSuccess: () => {
|
||||
// TODO: There won't be a loading indicator for this
|
||||
dispatch(resetSync());
|
||||
void dispatch(resetSync());
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -161,7 +161,7 @@ global.Actual = {
|
||||
reader.onload = async function (ev) {
|
||||
const filepath = `/uploads/${filename}`;
|
||||
|
||||
window.__actionsForMenu
|
||||
void window.__actionsForMenu
|
||||
.uploadFile(filename, ev.target.result)
|
||||
.then(() => resolve([filepath]));
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ import { useDispatch } from '@desktop-client/redux';
|
||||
import type { AppDispatch } from '@desktop-client/redux/store';
|
||||
|
||||
function invalidateQueries(queryClient: QueryClient, queryKey?: QueryKey) {
|
||||
queryClient.invalidateQueries({
|
||||
void queryClient.invalidateQueries({
|
||||
queryKey: queryKey ?? categoryQueries.lists(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export const loadBudgets = createAppAsyncThunk(
|
||||
async (_, { dispatch }) => {
|
||||
const budgets = await send('get-budgets');
|
||||
|
||||
await dispatch(setBudgets({ budgets }));
|
||||
dispatch(setBudgets({ budgets }));
|
||||
},
|
||||
);
|
||||
|
||||
@@ -31,7 +31,7 @@ export const loadRemoteFiles = createAppAsyncThunk(
|
||||
async (_, { dispatch }) => {
|
||||
const files = await send('get-remote-files');
|
||||
|
||||
await dispatch(setRemoteFiles({ remoteFiles: files }));
|
||||
dispatch(setRemoteFiles({ remoteFiles: files }));
|
||||
},
|
||||
);
|
||||
|
||||
@@ -41,7 +41,7 @@ export const loadAllFiles = createAppAsyncThunk(
|
||||
const budgets = await send('get-budgets');
|
||||
const files = await send('get-remote-files');
|
||||
|
||||
await dispatch(setAllFiles({ budgets, remoteFiles: files }));
|
||||
dispatch(setAllFiles({ budgets, remoteFiles: files }));
|
||||
|
||||
return getState().budgetfiles.allFiles;
|
||||
},
|
||||
@@ -56,7 +56,7 @@ type LoadBudgetPayload = {
|
||||
export const loadBudget = createAppAsyncThunk(
|
||||
`${sliceName}/loadBudget`,
|
||||
async ({ id, options = {} }: LoadBudgetPayload, { dispatch }) => {
|
||||
await dispatch(setAppState({ loadingText: t('Loading...') }));
|
||||
dispatch(setAppState({ loadingText: t('Loading...') }));
|
||||
|
||||
// Loading a budget may fail
|
||||
const { error } = await send('load-budget', { id, ...options });
|
||||
@@ -64,9 +64,7 @@ export const loadBudget = createAppAsyncThunk(
|
||||
if (error) {
|
||||
const message = getSyncError(error, id);
|
||||
if (error === 'out-of-sync-migrations') {
|
||||
await dispatch(
|
||||
pushModal({ modal: { name: 'out-of-sync-migrations' } }),
|
||||
);
|
||||
dispatch(pushModal({ modal: { name: 'out-of-sync-migrations' } }));
|
||||
} else if (error === 'out-of-sync-data') {
|
||||
// confirm is not available on iOS
|
||||
if (typeof window.confirm !== 'undefined') {
|
||||
@@ -79,7 +77,7 @@ export const loadBudget = createAppAsyncThunk(
|
||||
);
|
||||
|
||||
if (showBackups) {
|
||||
await dispatch(
|
||||
dispatch(
|
||||
pushModal({ modal: { name: 'load-backup', options: {} } }),
|
||||
);
|
||||
}
|
||||
@@ -90,11 +88,11 @@ export const loadBudget = createAppAsyncThunk(
|
||||
alert(message);
|
||||
}
|
||||
} else {
|
||||
await dispatch(closeModal());
|
||||
dispatch(closeModal());
|
||||
await dispatch(loadPrefs());
|
||||
}
|
||||
|
||||
await dispatch(setAppState({ loadingText: null }));
|
||||
dispatch(setAppState({ loadingText: null }));
|
||||
},
|
||||
);
|
||||
|
||||
@@ -103,11 +101,11 @@ export const closeBudget = createAppAsyncThunk(
|
||||
async (_, { dispatch, getState, extra: { queryClient } }) => {
|
||||
const prefs = getState().prefs.local;
|
||||
if (prefs && prefs.id) {
|
||||
await dispatch(resetApp());
|
||||
dispatch(resetApp());
|
||||
queryClient.clear();
|
||||
await dispatch(setAppState({ loadingText: t('Closing...') }));
|
||||
dispatch(setAppState({ loadingText: t('Closing...') }));
|
||||
await send('close-budget');
|
||||
await dispatch(setAppState({ loadingText: null }));
|
||||
dispatch(setAppState({ loadingText: null }));
|
||||
if (localStorage.getItem('SharedArrayBufferOverride')) {
|
||||
window.location.reload();
|
||||
}
|
||||
@@ -120,7 +118,7 @@ export const closeBudgetUI = createAppAsyncThunk(
|
||||
async (_, { dispatch, getState, extra: { queryClient } }) => {
|
||||
const prefs = getState().prefs.local;
|
||||
if (prefs && prefs.id) {
|
||||
await dispatch(resetApp());
|
||||
dispatch(resetApp());
|
||||
queryClient.clear();
|
||||
}
|
||||
},
|
||||
@@ -150,7 +148,7 @@ export const createBudget = createAppAsyncThunk(
|
||||
{ testMode = false, demoMode = false }: CreateBudgetPayload,
|
||||
{ dispatch },
|
||||
) => {
|
||||
await dispatch(
|
||||
dispatch(
|
||||
setAppState({
|
||||
loadingText:
|
||||
testMode || demoMode ? t('Making demo...') : t('Creating budget...'),
|
||||
@@ -163,14 +161,14 @@ export const createBudget = createAppAsyncThunk(
|
||||
await send('create-budget', { testMode });
|
||||
}
|
||||
|
||||
await dispatch(closeModal());
|
||||
dispatch(closeModal());
|
||||
|
||||
await dispatch(loadAllFiles());
|
||||
await dispatch(loadPrefs());
|
||||
|
||||
// Set the loadingText to null after we've loaded the budget prefs
|
||||
// so that the existing manager page doesn't flash
|
||||
await dispatch(setAppState({ loadingText: null }));
|
||||
dispatch(setAppState({ loadingText: null }));
|
||||
},
|
||||
);
|
||||
|
||||
@@ -206,7 +204,7 @@ export const duplicateBudget = createAppAsyncThunk(
|
||||
}
|
||||
|
||||
try {
|
||||
await dispatch(
|
||||
dispatch(
|
||||
setAppState({
|
||||
loadingText: t('Duplicating: {{oldName}} to: {{newName}}', {
|
||||
oldName,
|
||||
@@ -222,7 +220,7 @@ export const duplicateBudget = createAppAsyncThunk(
|
||||
open: loadBudget,
|
||||
});
|
||||
|
||||
await dispatch(closeModal());
|
||||
dispatch(closeModal());
|
||||
|
||||
if (managePage) {
|
||||
await dispatch(loadAllFiles());
|
||||
@@ -233,7 +231,7 @@ export const duplicateBudget = createAppAsyncThunk(
|
||||
? error
|
||||
: new Error('Error duplicating budget: ' + String(error));
|
||||
} finally {
|
||||
await dispatch(setAppState({ loadingText: null }));
|
||||
dispatch(setAppState({ loadingText: null }));
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -251,7 +249,7 @@ export const importBudget = createAppAsyncThunk(
|
||||
throw new Error(error);
|
||||
}
|
||||
|
||||
await dispatch(closeModal());
|
||||
dispatch(closeModal());
|
||||
await dispatch(loadPrefs());
|
||||
},
|
||||
);
|
||||
@@ -308,7 +306,7 @@ export const downloadBudget = createAppAsyncThunk(
|
||||
{ cloudFileId, replace = false }: DownloadBudgetPayload,
|
||||
{ dispatch },
|
||||
): Promise<string | null> => {
|
||||
await dispatch(
|
||||
dispatch(
|
||||
setAppState({
|
||||
loadingText: t('Downloading...'),
|
||||
}),
|
||||
@@ -329,14 +327,14 @@ export const downloadBudget = createAppAsyncThunk(
|
||||
),
|
||||
cloudFileId,
|
||||
onSuccess: () => {
|
||||
dispatch(downloadBudget({ cloudFileId, replace }));
|
||||
void dispatch(downloadBudget({ cloudFileId, replace }));
|
||||
},
|
||||
};
|
||||
|
||||
await dispatch(
|
||||
dispatch(
|
||||
pushModal({ modal: { name: 'fix-encryption-key', options: opts } }),
|
||||
);
|
||||
await dispatch(setAppState({ loadingText: null }));
|
||||
dispatch(setAppState({ loadingText: null }));
|
||||
} else if (error.reason === 'file-exists') {
|
||||
alert(
|
||||
t(
|
||||
@@ -362,7 +360,7 @@ export const downloadBudget = createAppAsyncThunk(
|
||||
downloadBudget({ cloudFileId, replace: true }),
|
||||
).unwrap();
|
||||
} else {
|
||||
await dispatch(setAppState({ loadingText: null }));
|
||||
dispatch(setAppState({ loadingText: null }));
|
||||
alert(getDownloadError(error));
|
||||
}
|
||||
return null;
|
||||
@@ -375,7 +373,7 @@ export const downloadBudget = createAppAsyncThunk(
|
||||
dispatch(loadAllFiles()),
|
||||
dispatch(loadBudget({ id })),
|
||||
]);
|
||||
await dispatch(setAppState({ loadingText: null }));
|
||||
dispatch(setAppState({ loadingText: null }));
|
||||
return id;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -115,7 +115,7 @@ function AppInner() {
|
||||
if (files) {
|
||||
const remoteFile = files.find(f => f.fileId === cloudFileId);
|
||||
if (remoteFile && remoteFile.deleted) {
|
||||
dispatch(closeBudget());
|
||||
void dispatch(closeBudget());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ function AppInner() {
|
||||
button: {
|
||||
title: t('Go to login'),
|
||||
action: () => {
|
||||
dispatch(signOut());
|
||||
void dispatch(signOut());
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -168,7 +168,7 @@ export function CommandBar() {
|
||||
const handleNavigate = useCallback(
|
||||
(path: string) => {
|
||||
setOpen(false);
|
||||
navigate(path);
|
||||
void navigate(path);
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ function NarrowNotSupported({
|
||||
const navigate = useNavigate();
|
||||
useEffect(() => {
|
||||
if (isNarrowWidth) {
|
||||
navigate(redirectTo);
|
||||
void navigate(redirectTo);
|
||||
}
|
||||
}, [isNarrowWidth, navigate, redirectTo]);
|
||||
return isNarrowWidth ? null : children;
|
||||
@@ -68,7 +68,7 @@ function WideNotSupported({
|
||||
const navigate = useNavigate();
|
||||
useEffect(() => {
|
||||
if (!isNarrowWidth) {
|
||||
navigate(redirectTo);
|
||||
void navigate(redirectTo);
|
||||
}
|
||||
}, [isNarrowWidth, navigate, redirectTo]);
|
||||
return isNarrowWidth ? children : null;
|
||||
@@ -136,13 +136,13 @@ export function FinancesApp() {
|
||||
);
|
||||
}
|
||||
|
||||
run();
|
||||
void run();
|
||||
});
|
||||
|
||||
useEffect(() => init(), []);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(getLatestAppVersion());
|
||||
void dispatch(getLatestAppVersion());
|
||||
}, [dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -15,17 +15,17 @@ export function GlobalKeys() {
|
||||
if (e.metaKey) {
|
||||
switch (e.key) {
|
||||
case '1':
|
||||
navigate('/budget');
|
||||
void navigate('/budget');
|
||||
break;
|
||||
case '2':
|
||||
navigate('/reports');
|
||||
void navigate('/reports');
|
||||
break;
|
||||
case '3':
|
||||
navigate('/accounts');
|
||||
void navigate('/accounts');
|
||||
break;
|
||||
case ',':
|
||||
if (Platform.OS === 'mac') {
|
||||
navigate('/settings');
|
||||
void navigate('/settings');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -68,7 +68,7 @@ export function LoggedInUser({
|
||||
}, [dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
initializeUserData();
|
||||
void initializeUserData();
|
||||
}, [initializeUserData]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -85,7 +85,7 @@ export function LoggedInUser({
|
||||
(type === 'error' && !userData.offline));
|
||||
|
||||
if (shouldReinitialize) {
|
||||
initializeUserData();
|
||||
void initializeUserData();
|
||||
} else {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ export function LoggedInUser({
|
||||
|
||||
async function onChangePassword() {
|
||||
await onCloseBudget();
|
||||
navigate('/change-password');
|
||||
void navigate('/change-password');
|
||||
}
|
||||
|
||||
const handleMenuSelect = async (type: string) => {
|
||||
@@ -106,27 +106,27 @@ export function LoggedInUser({
|
||||
|
||||
switch (type) {
|
||||
case 'change-password':
|
||||
onChangePassword();
|
||||
void onChangePassword();
|
||||
break;
|
||||
case 'sign-in':
|
||||
await onCloseBudget();
|
||||
navigate('/login');
|
||||
void navigate('/login');
|
||||
break;
|
||||
case 'user-access':
|
||||
navigate('/user-access');
|
||||
void navigate('/user-access');
|
||||
break;
|
||||
case 'user-directory':
|
||||
navigate('/user-directory');
|
||||
void navigate('/user-directory');
|
||||
break;
|
||||
case 'index':
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
break;
|
||||
case 'sign-out':
|
||||
dispatch(signOut());
|
||||
void dispatch(signOut());
|
||||
break;
|
||||
case 'config-server':
|
||||
await onCloseBudget();
|
||||
navigate('/config-server');
|
||||
void navigate('/config-server');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -197,7 +197,7 @@ export function ManageRules({
|
||||
undo.setUndoState('openModal', { name: 'manage-rules', options: {} });
|
||||
}
|
||||
|
||||
loadData();
|
||||
void loadData();
|
||||
|
||||
return () => {
|
||||
undo.setUndoState('openModal', null);
|
||||
|
||||
@@ -190,7 +190,7 @@ export function Modals() {
|
||||
{...modal.options}
|
||||
onClose={() => {
|
||||
modal.options.onClose?.();
|
||||
send('gocardless-poll-web-token-stop');
|
||||
void send('gocardless-poll-web-token-stop');
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -58,7 +58,7 @@ function compileMessage(
|
||||
e.preventDefault();
|
||||
if (actions[actionName]) {
|
||||
setLoading(true);
|
||||
await actions[actionName]();
|
||||
actions[actionName]();
|
||||
onRemove?.();
|
||||
}
|
||||
}}
|
||||
@@ -162,13 +162,13 @@ function Notification({
|
||||
|
||||
// Update scale, opacity, and y-position when index changes
|
||||
useEffect(() => {
|
||||
api.start({ scale, opacity: stackOpacity, y: yOffset });
|
||||
void api.start({ scale, opacity: stackOpacity, y: yOffset });
|
||||
}, [index, scale, stackOpacity, yOffset, api]);
|
||||
|
||||
const swipeHandlers = useSwipeable({
|
||||
onSwiping: ({ deltaX }) => {
|
||||
if (!isSwiped) {
|
||||
api.start({ x: deltaX });
|
||||
void api.start({ x: deltaX });
|
||||
}
|
||||
},
|
||||
onSwiped: ({ velocity, deltaX }) => {
|
||||
@@ -178,7 +178,7 @@ function Notification({
|
||||
|
||||
if (Math.abs(deltaX) > threshold || velocity > 0.5) {
|
||||
// Animate out & remove item after animation
|
||||
api.start({
|
||||
void api.start({
|
||||
x: direction * 1000,
|
||||
opacity: 0,
|
||||
onRest: onRemove,
|
||||
@@ -186,7 +186,7 @@ function Notification({
|
||||
setIsSwiped(true);
|
||||
} else {
|
||||
// Reset position if not swiped far enough
|
||||
api.start({ x: 0 });
|
||||
void api.start({ x: 0 });
|
||||
}
|
||||
},
|
||||
trackMouse: true,
|
||||
|
||||
@@ -107,7 +107,7 @@ export function ServerProvider({ children }: { children: ReactNode }) {
|
||||
setServerURL(serverURL);
|
||||
setVersion(await getServerVersion());
|
||||
}
|
||||
run();
|
||||
void run();
|
||||
}, []);
|
||||
|
||||
const refreshLoginMethods = useCallback(async () => {
|
||||
@@ -135,7 +135,7 @@ export function ServerProvider({ children }: { children: ReactNode }) {
|
||||
|
||||
useEffect(() => {
|
||||
if (serverURL) {
|
||||
send('subscribe-needs-bootstrap').then(
|
||||
void send('subscribe-needs-bootstrap').then(
|
||||
(data: Awaited<ReturnType<Handlers['subscribe-needs-bootstrap']>>) => {
|
||||
if ('hasServer' in data && data.hasServer) {
|
||||
setAvailableLoginMethods(data.availableLoginMethods || []);
|
||||
|
||||
@@ -21,7 +21,7 @@ export function UpdateNotification() {
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const onRestart = () => {
|
||||
dispatch(updateApp());
|
||||
void dispatch(updateApp());
|
||||
};
|
||||
|
||||
if (updateInfo && showUpdateNotification) {
|
||||
|
||||
@@ -383,13 +383,13 @@ class AccountInternal extends PureComponent<
|
||||
|
||||
// Important that any async work happens last so that the
|
||||
// listeners are set up synchronously
|
||||
await this.fetchTransactions(this.state.filterConditions);
|
||||
this.fetchTransactions(this.state.filterConditions);
|
||||
|
||||
// If there is a pending undo, apply it immediately (this happens
|
||||
// when an undo changes the location to this page)
|
||||
const lastUndoEvent = undo.getUndoState('undoEvent');
|
||||
if (lastUndoEvent) {
|
||||
onUndo(lastUndoEvent);
|
||||
void onUndo(lastUndoEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ class AccountInternal extends PureComponent<
|
||||
// things are listening to transactions and refetch
|
||||
// automatically (use ActualQL?)
|
||||
setTimeout(() => {
|
||||
this.refetchTransactions();
|
||||
void this.refetchTransactions();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
@@ -442,13 +442,13 @@ class AccountInternal extends PureComponent<
|
||||
};
|
||||
|
||||
refetchTransactions = async () => {
|
||||
this.paged?.run();
|
||||
void this.paged?.run();
|
||||
};
|
||||
|
||||
fetchTransactions = (filterConditions?: ConditionEntity[]) => {
|
||||
const query = this.makeRootTransactionsQuery();
|
||||
this.rootQuery = this.currentQuery = query;
|
||||
if (filterConditions) this.applyFilters(filterConditions);
|
||||
if (filterConditions) void this.applyFilters(filterConditions);
|
||||
else this.updateQuery(query);
|
||||
|
||||
if (this.props.accountId) {
|
||||
@@ -622,7 +622,7 @@ class AccountInternal extends PureComponent<
|
||||
accountName && accountName.replace(/[()]/g, '').replace(/\s+/g, '-');
|
||||
const filename = `${normalizedName || 'transactions'}.csv`;
|
||||
|
||||
window.Actual.saveFile(
|
||||
void window.Actual.saveFile(
|
||||
exportedTransactions,
|
||||
filename,
|
||||
t('Export transactions'),
|
||||
@@ -817,14 +817,14 @@ class AccountInternal extends PureComponent<
|
||||
);
|
||||
break;
|
||||
case 'close':
|
||||
this.props.dispatch(openAccountCloseModal({ accountId }));
|
||||
void this.props.dispatch(openAccountCloseModal({ accountId }));
|
||||
break;
|
||||
case 'reopen':
|
||||
this.props.onReopenAccount(accountId);
|
||||
break;
|
||||
case 'export':
|
||||
const accountName = this.getAccountTitle(account, accountId);
|
||||
this.onExport(accountName);
|
||||
void this.onExport(accountName);
|
||||
break;
|
||||
case 'toggle-balance':
|
||||
if (this.state.showBalances) {
|
||||
@@ -851,7 +851,7 @@ class AccountInternal extends PureComponent<
|
||||
this.setState({ sort: null }, () => {
|
||||
const filterConditions = this.state.filterConditions;
|
||||
if (filterConditions.length > 0) {
|
||||
this.applyFilters([...filterConditions]);
|
||||
void this.applyFilters([...filterConditions]);
|
||||
} else {
|
||||
this.fetchTransactions();
|
||||
}
|
||||
@@ -1070,18 +1070,18 @@ class AccountInternal extends PureComponent<
|
||||
};
|
||||
|
||||
onShowTransactions = async (ids: string[]) => {
|
||||
this.onApplyFilter({
|
||||
void this.onApplyFilter({
|
||||
customName: t('Selected transactions'),
|
||||
queryFilter: { id: { $oneof: ids } },
|
||||
});
|
||||
};
|
||||
|
||||
onBatchEdit = (name: keyof TransactionEntity, ids: string[]) => {
|
||||
this.props.onBatchEdit({
|
||||
void this.props.onBatchEdit({
|
||||
name,
|
||||
ids,
|
||||
onSuccess: updatedIds => {
|
||||
this.refetchTransactions();
|
||||
void this.refetchTransactions();
|
||||
|
||||
if (this.table.current) {
|
||||
this.table.current.edit(updatedIds[0], 'select', false);
|
||||
@@ -1091,11 +1091,14 @@ class AccountInternal extends PureComponent<
|
||||
};
|
||||
|
||||
onBatchDuplicate = (ids: string[]) => {
|
||||
this.props.onBatchDuplicate({ ids, onSuccess: this.refetchTransactions });
|
||||
void this.props.onBatchDuplicate({
|
||||
ids,
|
||||
onSuccess: this.refetchTransactions,
|
||||
});
|
||||
};
|
||||
|
||||
onBatchDelete = (ids: string[]) => {
|
||||
this.props.onBatchDelete({ ids, onSuccess: this.refetchTransactions });
|
||||
void this.props.onBatchDelete({ ids, onSuccess: this.refetchTransactions });
|
||||
};
|
||||
|
||||
onMakeAsSplitTransaction = async (ids: string[]) => {
|
||||
@@ -1134,7 +1137,7 @@ class AccountInternal extends PureComponent<
|
||||
updated: childTransactions,
|
||||
});
|
||||
|
||||
this.refetchTransactions();
|
||||
void this.refetchTransactions();
|
||||
};
|
||||
|
||||
onMakeAsNonSplitTransactions = async (ids: string[]) => {
|
||||
@@ -1204,7 +1207,7 @@ class AccountInternal extends PureComponent<
|
||||
|
||||
await send('transactions-batch-update', changes);
|
||||
|
||||
this.refetchTransactions();
|
||||
void this.refetchTransactions();
|
||||
|
||||
const transactionsToSelect = changes.updated.map(t => t.id);
|
||||
this.dispatchSelected?.({
|
||||
@@ -1257,7 +1260,7 @@ class AccountInternal extends PureComponent<
|
||||
};
|
||||
|
||||
onBatchLinkSchedule = (ids: string[]) => {
|
||||
this.props.onBatchLinkSchedule({
|
||||
void this.props.onBatchLinkSchedule({
|
||||
ids,
|
||||
account: this.props.accounts.find(a => a.id === this.props.accountId),
|
||||
onSuccess: this.refetchTransactions,
|
||||
@@ -1265,7 +1268,7 @@ class AccountInternal extends PureComponent<
|
||||
};
|
||||
|
||||
onBatchUnlinkSchedule = (ids: string[]) => {
|
||||
this.props.onBatchUnlinkSchedule({
|
||||
void this.props.onBatchUnlinkSchedule({
|
||||
ids,
|
||||
onSuccess: this.refetchTransactions,
|
||||
});
|
||||
@@ -1364,7 +1367,7 @@ class AccountInternal extends PureComponent<
|
||||
this.setState({
|
||||
filterId: { ...this.state.filterId, status: 'changed' } as SavedFilter,
|
||||
});
|
||||
this.applyFilters([...this.state.filterConditions]);
|
||||
void this.applyFilters([...this.state.filterConditions]);
|
||||
if (this.state.search !== '') {
|
||||
this.onSearch(this.state.search);
|
||||
}
|
||||
@@ -1376,13 +1379,13 @@ class AccountInternal extends PureComponent<
|
||||
f => f.id === this.state.filterId?.id,
|
||||
);
|
||||
this.setState({ filterConditionsOp: savedFilter.conditionsOp ?? 'and' });
|
||||
this.applyFilters([...savedFilter.conditions]);
|
||||
void this.applyFilters([...savedFilter.conditions]);
|
||||
} else {
|
||||
if (savedFilter.status) {
|
||||
this.setState({
|
||||
filterConditionsOp: savedFilter.conditionsOp ?? 'and',
|
||||
});
|
||||
this.applyFilters([...(savedFilter.conditions ?? [])]);
|
||||
void this.applyFilters([...(savedFilter.conditions ?? [])]);
|
||||
}
|
||||
}
|
||||
this.setState({ filterId: { ...this.state.filterId, ...savedFilter } });
|
||||
@@ -1391,7 +1394,7 @@ class AccountInternal extends PureComponent<
|
||||
onClearFilters = () => {
|
||||
this.setState({ filterConditionsOp: 'and' });
|
||||
this.setState({ filterId: undefined });
|
||||
this.applyFilters([]);
|
||||
void this.applyFilters([]);
|
||||
if (this.state.search !== '') {
|
||||
this.onSearch(this.state.search);
|
||||
}
|
||||
@@ -1401,7 +1404,7 @@ class AccountInternal extends PureComponent<
|
||||
oldCondition: RuleConditionEntity,
|
||||
updatedCondition: RuleConditionEntity,
|
||||
) => {
|
||||
this.applyFilters(
|
||||
void this.applyFilters(
|
||||
this.state.filterConditions.map(c =>
|
||||
c === oldCondition ? updatedCondition : c,
|
||||
),
|
||||
@@ -1418,7 +1421,9 @@ class AccountInternal extends PureComponent<
|
||||
};
|
||||
|
||||
onDeleteFilter = (condition: RuleConditionEntity) => {
|
||||
this.applyFilters(this.state.filterConditions.filter(c => c !== condition));
|
||||
void this.applyFilters(
|
||||
this.state.filterConditions.filter(c => c !== condition),
|
||||
);
|
||||
if (this.state.filterConditions.length === 1) {
|
||||
this.setState({ filterId: undefined });
|
||||
this.setState({ filterConditionsOp: 'and' });
|
||||
@@ -1456,7 +1461,7 @@ class AccountInternal extends PureComponent<
|
||||
filterId: { ...savedFilter, status: 'saved' },
|
||||
});
|
||||
this.setState({ filterConditionsOp: savedFilter.conditionsOp });
|
||||
this.applyFilters([...savedFilter.conditions]);
|
||||
void this.applyFilters([...savedFilter.conditions]);
|
||||
} else {
|
||||
// A condition was passed in.
|
||||
const condition = conditionOrSavedFilter;
|
||||
@@ -1472,7 +1477,7 @@ class AccountInternal extends PureComponent<
|
||||
status: this.state.filterId && 'changed',
|
||||
} as SavedFilter,
|
||||
});
|
||||
this.applyFilters([...filterConditions, condition]);
|
||||
void this.applyFilters([...filterConditions, condition]);
|
||||
}
|
||||
|
||||
if (this.state.search !== '') {
|
||||
@@ -1491,13 +1496,13 @@ class AccountInternal extends PureComponent<
|
||||
for (const id of scheduleIds) {
|
||||
await send('schedule/post-transaction', { id });
|
||||
}
|
||||
this.refetchTransactions();
|
||||
void this.refetchTransactions();
|
||||
break;
|
||||
case 'post-transaction-today':
|
||||
for (const id of scheduleIds) {
|
||||
await send('schedule/post-transaction', { id, today: true });
|
||||
}
|
||||
this.refetchTransactions();
|
||||
void this.refetchTransactions();
|
||||
break;
|
||||
case 'skip':
|
||||
for (const id of scheduleIds) {
|
||||
@@ -1642,7 +1647,7 @@ class AccountInternal extends PureComponent<
|
||||
// called directly from UI by sorting a column.
|
||||
// active filters need to be applied before sorting
|
||||
case isFiltered:
|
||||
this.applyFilters([...filterConditions]);
|
||||
void this.applyFilters([...filterConditions]);
|
||||
sortCurrentQuery(this, sortField, sortAscDesc);
|
||||
break;
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ export function AccountSyncCheck() {
|
||||
setOpen(false);
|
||||
|
||||
if (acc.account_id) {
|
||||
authorizeBank(dispatch);
|
||||
void authorizeBank(dispatch);
|
||||
}
|
||||
},
|
||||
[dispatch],
|
||||
|
||||
@@ -108,7 +108,7 @@ function UserAccessContent({ isModal }: ManageUserAccessContentProps) {
|
||||
}
|
||||
}
|
||||
|
||||
loadData();
|
||||
void loadData();
|
||||
|
||||
return () => {
|
||||
undo.setUndoState('openModal', null);
|
||||
|
||||
@@ -81,7 +81,7 @@ export const UserAccessRow = memo(
|
||||
button: {
|
||||
title: t('Go to login'),
|
||||
action: () => {
|
||||
dispatch(signOut());
|
||||
void dispatch(signOut());
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -135,7 +135,7 @@ function UserDirectoryContent({ isModal }: ManageUserDirectoryContentProps) {
|
||||
await loadUsers();
|
||||
}
|
||||
|
||||
loadData();
|
||||
void loadData();
|
||||
|
||||
return () => {
|
||||
undo.setUndoState('openModal', null);
|
||||
@@ -164,7 +164,7 @@ function UserDirectoryContent({ isModal }: ManageUserDirectoryContentProps) {
|
||||
button: {
|
||||
title: t('Go to login'),
|
||||
action: () => {
|
||||
dispatch(signOut());
|
||||
void dispatch(signOut());
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -246,7 +246,7 @@ export function EditSyncAccount({ account }: EditSyncAccountProps) {
|
||||
<Button
|
||||
style={{ color: theme.errorText }}
|
||||
onPress={() => {
|
||||
onUnlink(close);
|
||||
void onUnlink(close);
|
||||
}}
|
||||
>
|
||||
<Trans>Unlink account</Trans>
|
||||
@@ -259,7 +259,7 @@ export function EditSyncAccount({ account }: EditSyncAccountProps) {
|
||||
<Button
|
||||
variant="primary"
|
||||
onPress={() => {
|
||||
onSave(close);
|
||||
void onSave(close);
|
||||
}}
|
||||
>
|
||||
<Trans>Save</Trans>
|
||||
|
||||
@@ -71,12 +71,12 @@ export function Budget() {
|
||||
setInitialized(true);
|
||||
}
|
||||
|
||||
run();
|
||||
void run();
|
||||
});
|
||||
useEffect(() => init(), []);
|
||||
|
||||
const loadBoundBudgets = useEffectEvent(() => {
|
||||
send('get-budget-bounds').then(({ start, end }) => {
|
||||
void send('get-budget-bounds').then(({ start, end }) => {
|
||||
if (bounds.start !== start || bounds.end !== end) {
|
||||
setBounds({ start, end });
|
||||
}
|
||||
@@ -141,7 +141,7 @@ export function Budget() {
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
navigate('/accounts', {
|
||||
void navigate('/accounts', {
|
||||
state: {
|
||||
goBack: true,
|
||||
filterConditions,
|
||||
|
||||
@@ -106,7 +106,7 @@ const ButtonLink = ({ to, style, activeStyle, ...props }: ButtonLinkProps) => {
|
||||
variant={props.buttonVariant}
|
||||
onPress={e => {
|
||||
props.onPress?.(e);
|
||||
navigate(path);
|
||||
void navigate(path);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -298,7 +298,7 @@ function QueryItem({
|
||||
|
||||
setAllMonths(allMonths);
|
||||
}
|
||||
run();
|
||||
void run();
|
||||
}, [locale]);
|
||||
|
||||
const filters = useRuleConditionFilters(
|
||||
|
||||
@@ -270,7 +270,7 @@ type BudgetFileListItemProps = ComponentPropsWithoutRef<
|
||||
typeof GridListItem<File>
|
||||
> & {
|
||||
quickSwitchMode: boolean;
|
||||
onSelect: (file: File) => void;
|
||||
onSelect: (file: File) => Promise<void>;
|
||||
onDelete: (file: File) => void;
|
||||
onDuplicate: (file: File) => void;
|
||||
currentUserId: string;
|
||||
@@ -379,7 +379,7 @@ function BudgetFileListItem({
|
||||
type BudgetFileListProps = {
|
||||
files: File[];
|
||||
quickSwitchMode: boolean;
|
||||
onSelect: (file: File) => void;
|
||||
onSelect: (file: File) => Promise<void>;
|
||||
onDelete: (file: File) => void;
|
||||
onDuplicate: (file: File) => void;
|
||||
currentUserId: string;
|
||||
@@ -447,7 +447,7 @@ function RefreshButton({ style, onRefresh }: RefreshButtonProps) {
|
||||
|
||||
async function _onRefresh() {
|
||||
setLoading(true);
|
||||
await onRefresh();
|
||||
onRefresh();
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ export function BudgetFileSelection({
|
||||
|
||||
useEffect(() => {
|
||||
if (multiuserEnabled && !userData?.offline) {
|
||||
fetchUsers();
|
||||
void fetchUsers();
|
||||
}
|
||||
}, [multiuserEnabled, userData?.offline, fetchUsers]);
|
||||
|
||||
@@ -583,13 +583,13 @@ export function BudgetFileSelection({
|
||||
const onCreate = ({ testMode = false } = {}) => {
|
||||
if (!creating) {
|
||||
setCreating(true);
|
||||
dispatch(createBudget({ testMode }));
|
||||
void dispatch(createBudget({ testMode }));
|
||||
}
|
||||
};
|
||||
|
||||
const refresh = () => {
|
||||
dispatch(getUserData());
|
||||
dispatch(loadAllFiles());
|
||||
void dispatch(getUserData());
|
||||
void dispatch(loadAllFiles());
|
||||
};
|
||||
|
||||
const initialMount = useInitialMount();
|
||||
|
||||
@@ -88,9 +88,9 @@ export function ElectronServerConfig({
|
||||
await window.globalThis.Actual.stopSyncServer();
|
||||
await window.globalThis.Actual.startSyncServer();
|
||||
setStartingSyncServer(false);
|
||||
initElectronSyncServerRunningStatus();
|
||||
void initElectronSyncServerRunningStatus();
|
||||
await setServerUrl(`http://localhost:${electronServerPort}`);
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
} catch (error) {
|
||||
setStartingSyncServer(false);
|
||||
setConfigError(t('Failed to configure sync server'));
|
||||
@@ -108,7 +108,7 @@ export function ElectronServerConfig({
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
initElectronSyncServerRunningStatus();
|
||||
void initElectronSyncServerRunningStatus();
|
||||
}, []);
|
||||
|
||||
async function dontUseSyncServer() {
|
||||
@@ -344,7 +344,7 @@ export function ConfigServer() {
|
||||
} else {
|
||||
setLoading(false);
|
||||
await dispatch(signOut());
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,13 +371,13 @@ export function ConfigServer() {
|
||||
async function onSkip() {
|
||||
await setServerUrl(null);
|
||||
await dispatch(loggedIn());
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
}
|
||||
|
||||
async function onCreateTestFile() {
|
||||
await setServerUrl(null);
|
||||
await dispatch(createBudget({ testMode: true }));
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
}
|
||||
|
||||
const [syncServerConfig] = useGlobalPref('syncServerConfig');
|
||||
@@ -542,7 +542,7 @@ export function ConfigServer() {
|
||||
style={{ marginLeft: 15 }}
|
||||
onPress={async () => {
|
||||
await onCreateTestFile();
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
}}
|
||||
>
|
||||
<Trans>Create test file</Trans>
|
||||
|
||||
@@ -88,7 +88,7 @@ export function ManagementApp() {
|
||||
dispatch(setAppState({ managerHasInitialized: true }));
|
||||
}
|
||||
|
||||
fetchData();
|
||||
void fetchData();
|
||||
}, [dispatch]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -55,7 +55,7 @@ export function Bootstrap() {
|
||||
setError(error);
|
||||
} else {
|
||||
await refreshLoginMethods();
|
||||
navigate('/login');
|
||||
void navigate('/login');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export function ChangePassword() {
|
||||
} else {
|
||||
setMessage(t('Password successfully changed'));
|
||||
await send('subscribe-sign-in', { password });
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export function Error() {
|
||||
const { error } = (location.state || {}) as { error? };
|
||||
|
||||
function onTryAgain() {
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -108,12 +108,12 @@ function OpenIdLogin({ setError }) {
|
||||
if (error) {
|
||||
setError(error);
|
||||
} else {
|
||||
navigate('/');
|
||||
void navigate('/');
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
send('owner-created').then(created => setWarnMasterCreation(!created));
|
||||
void send('owner-created').then(created => setWarnMasterCreation(!created));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -202,7 +202,7 @@ function OpenIdLogin({ setError }) {
|
||||
variant="bare"
|
||||
isDisabled={firstLoginPassword === '' && warnMasterCreation}
|
||||
onPress={() => {
|
||||
send('get-openid-config', {
|
||||
void send('get-openid-config', {
|
||||
password: firstLoginPassword,
|
||||
}).then(config => {
|
||||
if ('error' in config) {
|
||||
@@ -259,7 +259,7 @@ function OpenIdLogin({ setError }) {
|
||||
</Button>,
|
||||
]}
|
||||
onSetOpenId={async config => {
|
||||
onSetOpenId(config);
|
||||
void onSetOpenId(config);
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
@@ -316,7 +316,7 @@ export function Login() {
|
||||
|
||||
useEffect(() => {
|
||||
if (checked && !searchParams.has('error')) {
|
||||
(async () => {
|
||||
void (async () => {
|
||||
if (method === 'header') {
|
||||
setError(null);
|
||||
const { error } = await send('subscribe-sign-in', {
|
||||
@@ -327,7 +327,7 @@ export function Login() {
|
||||
if (error) {
|
||||
setError(error);
|
||||
} else {
|
||||
dispatch(loggedIn());
|
||||
void dispatch(loggedIn());
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -9,8 +9,8 @@ export function OpenIdCallback() {
|
||||
const dispatch = useDispatch();
|
||||
useEffect(() => {
|
||||
const token = new URLSearchParams(window.location.search).get('token');
|
||||
send('subscribe-set-token', { token: token as string }).then(() => {
|
||||
dispatch(loggedIn());
|
||||
void send('subscribe-set-token', { token: token as string }).then(() => {
|
||||
void dispatch(loggedIn());
|
||||
});
|
||||
});
|
||||
return null;
|
||||
|
||||
@@ -36,7 +36,7 @@ export function useBootstrapped(redirect = true) {
|
||||
const ensure = url => {
|
||||
if (location.pathname !== url) {
|
||||
if (redirect) {
|
||||
navigate(url);
|
||||
void navigate(url);
|
||||
}
|
||||
} else {
|
||||
setChecked(true);
|
||||
@@ -56,7 +56,7 @@ export function useBootstrapped(redirect = true) {
|
||||
|
||||
if ('error' in result || !result.hasServer) {
|
||||
console.log('error' in result && result.error);
|
||||
navigate('/config-server');
|
||||
void navigate('/config-server');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export function useBootstrapped(redirect = true) {
|
||||
> = await send('subscribe-needs-bootstrap');
|
||||
|
||||
if ('error' in result) {
|
||||
navigate('/error', { state: { error: result.error } });
|
||||
void navigate('/error', { state: { error: result.error } });
|
||||
} else if (result.bootstrapped) {
|
||||
ensure(`/login`);
|
||||
|
||||
@@ -89,7 +89,7 @@ export function useBootstrapped(redirect = true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
run();
|
||||
void run();
|
||||
}, [
|
||||
location,
|
||||
navigate,
|
||||
|
||||
@@ -141,7 +141,7 @@ function AccountHeader({ account }: { readonly account: AccountEntity }) {
|
||||
);
|
||||
|
||||
const onCloseAccount = useCallback(() => {
|
||||
dispatch(openAccountCloseModal({ accountId: account.id }));
|
||||
void dispatch(openAccountCloseModal({ accountId: account.id }));
|
||||
}, [account.id, dispatch]);
|
||||
|
||||
const { mutate: reopenAccount } = useReopenAccountMutation();
|
||||
|
||||
@@ -133,7 +133,7 @@ function TransactionListWithPreviews({
|
||||
const onOpenTransaction = useCallback(
|
||||
(transaction: TransactionEntity) => {
|
||||
if (!isPreviewId(transaction.id)) {
|
||||
navigate(`/transactions/${transaction.id}`);
|
||||
void navigate(`/transactions/${transaction.id}`);
|
||||
} else {
|
||||
dispatch(
|
||||
pushModal({
|
||||
|
||||
@@ -515,7 +515,7 @@ export function AccountsPage() {
|
||||
|
||||
const onOpenAccount = useCallback(
|
||||
(account: AccountEntity) => {
|
||||
navigate(`/accounts/${account.id}`);
|
||||
void navigate(`/accounts/${account.id}`);
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
|
||||
@@ -63,7 +63,7 @@ function TransactionListWithPreviews() {
|
||||
const onOpenTransaction = useCallback(
|
||||
(transaction: TransactionEntity) => {
|
||||
if (!isPreviewId(transaction.id)) {
|
||||
navigate(`/transactions/${transaction.id}`);
|
||||
void navigate(`/transactions/${transaction.id}`);
|
||||
} else {
|
||||
dispatch(
|
||||
pushModal({
|
||||
|
||||
@@ -74,7 +74,7 @@ function TransactionListWithPreviews() {
|
||||
const onOpenTransaction = useCallback(
|
||||
(transaction: TransactionEntity) => {
|
||||
if (!isPreviewId(transaction.id)) {
|
||||
navigate(`/transactions/${transaction.id}`);
|
||||
void navigate(`/transactions/${transaction.id}`);
|
||||
} else {
|
||||
dispatch(
|
||||
pushModal({
|
||||
|
||||
@@ -74,7 +74,7 @@ function TransactionListWithPreviews() {
|
||||
const onOpenTransaction = useCallback(
|
||||
(transaction: TransactionEntity) => {
|
||||
if (!isPreviewId(transaction.id)) {
|
||||
navigate(`/transactions/${transaction.id}`);
|
||||
void navigate(`/transactions/${transaction.id}`);
|
||||
} else {
|
||||
dispatch(
|
||||
pushModal({
|
||||
|
||||
@@ -46,12 +46,12 @@ export function MobileBankSyncAccountEditPage() {
|
||||
} = useBankSyncAccountSettings(accountId!);
|
||||
|
||||
const handleCancel = () => {
|
||||
navigate('/bank-sync');
|
||||
void navigate('/bank-sync');
|
||||
};
|
||||
|
||||
const handleSave = async () => {
|
||||
saveSettings();
|
||||
navigate('/bank-sync');
|
||||
void navigate('/bank-sync');
|
||||
};
|
||||
|
||||
const unlinkAccount = useUnlinkAccountMutation();
|
||||
|
||||
@@ -98,7 +98,7 @@ export function MobileBankSyncPage() {
|
||||
(account: AccountEntity, action: 'link' | 'edit') => {
|
||||
switch (action) {
|
||||
case 'edit':
|
||||
navigate(`/bank-sync/account/${account.id}/edit`);
|
||||
void navigate(`/bank-sync/account/${account.id}/edit`);
|
||||
break;
|
||||
case 'link':
|
||||
dispatch(
|
||||
|
||||
@@ -114,7 +114,7 @@ export function BudgetPage() {
|
||||
setInitialized(true);
|
||||
}
|
||||
|
||||
init();
|
||||
void init();
|
||||
}, [budgetType, startMonth, dispatch, spreadsheet]);
|
||||
|
||||
const onBudgetAction = useCallback(
|
||||
@@ -479,7 +479,7 @@ export function BudgetPage() {
|
||||
);
|
||||
|
||||
const onSwitchBudgetFile = useCallback(() => {
|
||||
dispatch(closeBudget());
|
||||
void dispatch(closeBudget());
|
||||
}, [dispatch]);
|
||||
|
||||
const onOpenBudgetMonthMenu = useCallback(
|
||||
@@ -587,7 +587,7 @@ export function BudgetPage() {
|
||||
<SheetNameProvider name={monthUtils.sheetForMonth(startMonth)}>
|
||||
<SyncRefresh
|
||||
onSync={async () => {
|
||||
dispatch(sync());
|
||||
void dispatch(sync());
|
||||
}}
|
||||
>
|
||||
{({ onRefresh }) => (
|
||||
|
||||
@@ -75,7 +75,7 @@ function TransactionListWithPreviews({
|
||||
(transaction: TransactionEntity) => {
|
||||
// details of how the native app used to handle preview transactions here can be found at commit 05e58279
|
||||
if (!isPreviewId(transaction.id)) {
|
||||
navigate(`/transactions/${transaction.id}`);
|
||||
void navigate(`/transactions/${transaction.id}`);
|
||||
}
|
||||
},
|
||||
[navigate],
|
||||
|
||||
@@ -413,7 +413,7 @@ export function ExpenseCategoryListItem({
|
||||
if (!category) {
|
||||
return;
|
||||
}
|
||||
navigate(`/categories/${category.id}?month=${month}`);
|
||||
void navigate(`/categories/${category.id}?month=${month}`);
|
||||
}, [category, month, navigate]);
|
||||
|
||||
if (!category) {
|
||||
|
||||
@@ -196,7 +196,7 @@ export function IncomeCategoryListItem({
|
||||
return null;
|
||||
}
|
||||
|
||||
navigate(`/categories/${category.id}?month=${month}`);
|
||||
void navigate(`/categories/${category.id}?month=${month}`);
|
||||
}, [category, month, navigate]);
|
||||
|
||||
const onCarryover = useCallback(
|
||||
|
||||
@@ -43,7 +43,7 @@ export function UncategorizedTransactions() {
|
||||
(transaction: TransactionEntity) => {
|
||||
// details of how the native app used to handle preview transactions here can be found at commit 05e58279
|
||||
if (!isPreviewId(transaction.id)) {
|
||||
navigate(`/transactions/${transaction.id}`);
|
||||
void navigate(`/transactions/${transaction.id}`);
|
||||
}
|
||||
},
|
||||
[navigate],
|
||||
|
||||
@@ -43,13 +43,13 @@ export function MobilePayeeEditPage() {
|
||||
setIsLoading(false);
|
||||
} else {
|
||||
// Payee not found, navigate back to payees list
|
||||
navigate('/payees');
|
||||
void navigate('/payees');
|
||||
}
|
||||
}
|
||||
}, [id, payees, navigate]);
|
||||
|
||||
const handleCancel = useCallback(() => {
|
||||
navigate(-1);
|
||||
void navigate(-1);
|
||||
}, [navigate]);
|
||||
|
||||
const handleSave = useCallback(async () => {
|
||||
@@ -67,7 +67,7 @@ export function MobilePayeeEditPage() {
|
||||
newName: editedPayeeName.trim(),
|
||||
}),
|
||||
});
|
||||
navigate('/payees');
|
||||
void navigate('/payees');
|
||||
} catch (error) {
|
||||
console.error('Failed to update payee:', error);
|
||||
dispatch(
|
||||
|
||||
@@ -42,7 +42,7 @@ export function MobilePayeesPage() {
|
||||
|
||||
const handlePayeePress = useCallback(
|
||||
(payee: PayeeEntity) => {
|
||||
navigate(`/payees/${payee.id}`);
|
||||
void navigate(`/payees/${payee.id}`);
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
@@ -56,18 +56,18 @@ export function MobilePayeesPage() {
|
||||
id: payee.id,
|
||||
});
|
||||
const ruleIds = associatedRules.map(rule => rule.id).join(',');
|
||||
navigate(`/rules?visible-rules=${ruleIds}`);
|
||||
void navigate(`/rules?visible-rules=${ruleIds}`);
|
||||
return;
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch payee rules:', error);
|
||||
// Fallback to general rules page
|
||||
navigate('/rules');
|
||||
void navigate('/rules');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Create a new rule for the payee
|
||||
navigate('/rules/new', {
|
||||
void navigate('/rules/new', {
|
||||
state: {
|
||||
rule: {
|
||||
conditions: [
|
||||
|
||||
@@ -11,7 +11,7 @@ export function AddRuleButton() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleAddRule = useCallback(() => {
|
||||
navigate('/rules/new');
|
||||
void navigate('/rules/new');
|
||||
}, [navigate]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -56,13 +56,13 @@ export function MobileRuleEditPage() {
|
||||
setRule(loadedRule);
|
||||
} else {
|
||||
// Rule not found, navigate back to rules list
|
||||
navigate('/rules');
|
||||
void navigate('/rules');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Failed to load rule:', error);
|
||||
// Navigate back to rules list if rule not found
|
||||
navigate('/rules');
|
||||
void navigate('/rules');
|
||||
})
|
||||
.finally(() => {
|
||||
setIsLoading(false);
|
||||
@@ -100,11 +100,11 @@ export function MobileRuleEditPage() {
|
||||
});
|
||||
}
|
||||
// Navigate back to rules list
|
||||
navigate('/rules');
|
||||
void navigate('/rules');
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
navigate(-1);
|
||||
void navigate(-1);
|
||||
};
|
||||
|
||||
const handleDelete = () => {
|
||||
@@ -125,7 +125,7 @@ export function MobileRuleEditPage() {
|
||||
showUndoNotification({
|
||||
message: t('Rule deleted successfully'),
|
||||
});
|
||||
navigate('/rules');
|
||||
void navigate('/rules');
|
||||
} catch (error) {
|
||||
console.error('Failed to delete rule:', error);
|
||||
dispatch(
|
||||
|
||||
@@ -94,13 +94,13 @@ export function MobileRulesPage() {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
loadRules();
|
||||
void loadRules();
|
||||
}, [loadRules]);
|
||||
|
||||
// Listen for undo events to refresh rules list
|
||||
useEffect(() => {
|
||||
const onUndo = () => {
|
||||
loadRules();
|
||||
void loadRules();
|
||||
};
|
||||
|
||||
const lastUndoEvent = undo.getUndoState('undoEvent');
|
||||
@@ -113,7 +113,7 @@ export function MobileRulesPage() {
|
||||
|
||||
const handleRulePress = useCallback(
|
||||
(rule: RuleEntity) => {
|
||||
navigate(`/rules/${rule.id}`);
|
||||
void navigate(`/rules/${rule.id}`);
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ export function AddScheduleButton() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleAddSchedule = useCallback(() => {
|
||||
navigate('/schedules/new');
|
||||
void navigate('/schedules/new');
|
||||
}, [navigate]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -126,11 +126,11 @@ export function MobileScheduleEditPage() {
|
||||
});
|
||||
|
||||
// Navigate back to schedules list
|
||||
navigate('/schedules');
|
||||
void navigate('/schedules');
|
||||
}
|
||||
|
||||
async function onEditRule(ruleId: string) {
|
||||
navigate(`/rules/${ruleId}`);
|
||||
void navigate(`/rules/${ruleId}`);
|
||||
}
|
||||
|
||||
async function onLinkTransactions(ids: string[], scheduleId?: string) {
|
||||
|
||||
@@ -90,7 +90,7 @@ export function MobileSchedulesPage() {
|
||||
|
||||
const handleSchedulePress = useCallback(
|
||||
(schedule: ScheduleEntity) => {
|
||||
navigate(`/schedules/${schedule.id}`);
|
||||
void navigate(`/schedules/${schedule.id}`);
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
|
||||
@@ -25,7 +25,7 @@ export function AddTransactionButton({
|
||||
aria-label={t('Add transaction')}
|
||||
style={{ margin: 10 }}
|
||||
onPress={() => {
|
||||
navigate(to, { state: { accountId, categoryId } });
|
||||
void navigate(to, { state: { accountId, categoryId } });
|
||||
}}
|
||||
>
|
||||
<SvgAdd width={20} height={20} />
|
||||
|
||||
@@ -683,7 +683,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
}
|
||||
|
||||
onSave(transactionsToSave);
|
||||
navigate(-1);
|
||||
void navigate(-1);
|
||||
};
|
||||
|
||||
const today = monthUtils.currentDay();
|
||||
@@ -741,7 +741,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
},
|
||||
}),
|
||||
);
|
||||
navigate(-1);
|
||||
void navigate(-1);
|
||||
},
|
||||
onCancel: onConfirmSave,
|
||||
},
|
||||
@@ -787,7 +787,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
value: TransactionEntity[Field],
|
||||
) => {
|
||||
const newTransaction = { ...serializedTransaction, [name]: value };
|
||||
await onUpdate(newTransaction, name);
|
||||
onUpdate(newTransaction, name);
|
||||
onClearActiveEdit();
|
||||
|
||||
if (name === 'account') {
|
||||
@@ -800,7 +800,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
const onTotalAmountUpdate = useCallback(
|
||||
(value: number) => {
|
||||
if (transaction.amount !== value) {
|
||||
onUpdateInner(transaction, 'amount', value);
|
||||
void onUpdateInner(transaction, 'amount', value);
|
||||
}
|
||||
},
|
||||
[onUpdateInner, transaction],
|
||||
@@ -836,7 +836,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
unserializedTransaction.date,
|
||||
),
|
||||
onSelect: categoryId => {
|
||||
onUpdateInner(transactionToEdit, name, categoryId);
|
||||
void onUpdateInner(transactionToEdit, name, categoryId);
|
||||
},
|
||||
onClose: () => {
|
||||
onClearActiveEdit();
|
||||
@@ -853,7 +853,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
name: 'account-autocomplete',
|
||||
options: {
|
||||
onSelect: accountId => {
|
||||
onUpdateInner(transactionToEdit, name, accountId);
|
||||
void onUpdateInner(transactionToEdit, name, accountId);
|
||||
},
|
||||
onClose: () => {
|
||||
onClearActiveEdit();
|
||||
@@ -870,7 +870,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
name: 'payee-autocomplete',
|
||||
options: {
|
||||
onSelect: payeeId => {
|
||||
onUpdateInner(transactionToEdit, name, payeeId);
|
||||
void onUpdateInner(transactionToEdit, name, payeeId);
|
||||
},
|
||||
onClose: () => {
|
||||
onClearActiveEdit();
|
||||
@@ -889,7 +889,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
name,
|
||||
onSubmit: (name, value) => {
|
||||
if (typeof value === 'object' && 'useRegex' in value) {
|
||||
onUpdateInner(
|
||||
void onUpdateInner(
|
||||
transactionToEdit,
|
||||
name,
|
||||
applyFindReplace(
|
||||
@@ -900,7 +900,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
),
|
||||
);
|
||||
} else {
|
||||
onUpdateInner(transactionToEdit, name, value);
|
||||
void onUpdateInner(transactionToEdit, name, value);
|
||||
}
|
||||
},
|
||||
onClose: () => {
|
||||
@@ -949,7 +949,7 @@ const TransactionEditInner = memo<TransactionEditInnerProps>(
|
||||
return;
|
||||
}
|
||||
|
||||
navigate(-1);
|
||||
void navigate(-1);
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1360,7 +1360,7 @@ function TransactionEditUnconnected({
|
||||
}
|
||||
}
|
||||
if (transactionId !== 'new') {
|
||||
fetchTransaction();
|
||||
void fetchTransaction();
|
||||
} else {
|
||||
isAdding.current = true;
|
||||
}
|
||||
@@ -1632,7 +1632,7 @@ function TransactionEditUnconnected({
|
||||
<Button
|
||||
variant="primary"
|
||||
onPress={() => {
|
||||
navigate('/budget');
|
||||
void navigate('/budget');
|
||||
}}
|
||||
>
|
||||
<Trans>Go to budget</Trans>
|
||||
|
||||
@@ -483,7 +483,7 @@ function SelectedTransactionsFloatingActionBar({
|
||||
getItemStyle={getMenuItemStyle}
|
||||
style={{ backgroundColor: theme.floatingActionBarBackground }}
|
||||
onMenuSelect={name => {
|
||||
onBatchEdit?.({
|
||||
void onBatchEdit?.({
|
||||
name,
|
||||
ids: selectedTransactionsArray,
|
||||
onSuccess: (ids, name, value, mode) => {
|
||||
@@ -519,13 +519,13 @@ function SelectedTransactionsFloatingActionBar({
|
||||
[String(displayValue)]: () => {
|
||||
switch (name) {
|
||||
case 'account':
|
||||
navigate(`/accounts/${value}`);
|
||||
void navigate(`/accounts/${value}`);
|
||||
break;
|
||||
case 'category':
|
||||
navigate(`/categories/${value}`);
|
||||
void navigate(`/categories/${value}`);
|
||||
break;
|
||||
case 'payee':
|
||||
navigate(`/payees`);
|
||||
void navigate(`/payees`);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -601,7 +601,7 @@ function SelectedTransactionsFloatingActionBar({
|
||||
style={{ backgroundColor: theme.floatingActionBarBackground }}
|
||||
onMenuSelect={type => {
|
||||
if (type === 'duplicate') {
|
||||
onBatchDuplicate?.({
|
||||
void onBatchDuplicate?.({
|
||||
ids: selectedTransactionsArray,
|
||||
onSuccess: ids => {
|
||||
showUndoNotification({
|
||||
@@ -613,7 +613,7 @@ function SelectedTransactionsFloatingActionBar({
|
||||
},
|
||||
});
|
||||
} else if (type === 'link-schedule') {
|
||||
onBatchLinkSchedule?.({
|
||||
void onBatchLinkSchedule?.({
|
||||
ids: selectedTransactionsArray,
|
||||
onSuccess: (ids, schedule) => {
|
||||
// TODO: When schedule becomes available in mobile, update undo notification message
|
||||
@@ -627,7 +627,7 @@ function SelectedTransactionsFloatingActionBar({
|
||||
},
|
||||
});
|
||||
} else if (type === 'unlink-schedule') {
|
||||
onBatchUnlinkSchedule?.({
|
||||
void onBatchUnlinkSchedule?.({
|
||||
ids: selectedTransactionsArray,
|
||||
onSuccess: ids => {
|
||||
showUndoNotification({
|
||||
@@ -639,7 +639,7 @@ function SelectedTransactionsFloatingActionBar({
|
||||
},
|
||||
});
|
||||
} else if (type === 'delete') {
|
||||
onBatchDelete?.({
|
||||
void onBatchDelete?.({
|
||||
ids: selectedTransactionsArray,
|
||||
onSuccess: ids => {
|
||||
showUndoNotification({
|
||||
@@ -652,7 +652,7 @@ function SelectedTransactionsFloatingActionBar({
|
||||
},
|
||||
});
|
||||
} else if (type === 'transfer') {
|
||||
onSetTransfer?.(selectedTransactionsArray, payees, ids =>
|
||||
void onSetTransfer?.(selectedTransactionsArray, payees, ids =>
|
||||
showUndoNotification({
|
||||
message: t(
|
||||
'Successfully marked {{count}} transactions as transfer.',
|
||||
@@ -663,7 +663,7 @@ function SelectedTransactionsFloatingActionBar({
|
||||
}),
|
||||
);
|
||||
} else if (type === 'merge') {
|
||||
onMerge?.(selectedTransactionsArray, () =>
|
||||
void onMerge?.(selectedTransactionsArray, () =>
|
||||
showUndoNotification({
|
||||
message: t('Successfully merged transactions'),
|
||||
}),
|
||||
|
||||
@@ -65,9 +65,9 @@ export function CreateAccountModal({
|
||||
}
|
||||
|
||||
if (upgradingAccountId == null) {
|
||||
authorizeBank(dispatch);
|
||||
void authorizeBank(dispatch);
|
||||
} else {
|
||||
authorizeBank(dispatch);
|
||||
void authorizeBank(dispatch);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -257,11 +257,11 @@ export function CreateAccountModal({
|
||||
};
|
||||
|
||||
const onGoCardlessReset = () => {
|
||||
send('secret-set', {
|
||||
void send('secret-set', {
|
||||
name: 'gocardless_secretId',
|
||||
value: null,
|
||||
}).then(() => {
|
||||
send('secret-set', {
|
||||
void send('secret-set', {
|
||||
name: 'gocardless_secretKey',
|
||||
value: null,
|
||||
}).then(() => {
|
||||
@@ -271,11 +271,11 @@ export function CreateAccountModal({
|
||||
};
|
||||
|
||||
const onSimpleFinReset = () => {
|
||||
send('secret-set', {
|
||||
void send('secret-set', {
|
||||
name: 'simplefin_token',
|
||||
value: null,
|
||||
}).then(() => {
|
||||
send('secret-set', {
|
||||
void send('secret-set', {
|
||||
name: 'simplefin_accessKey',
|
||||
value: null,
|
||||
}).then(() => {
|
||||
@@ -285,15 +285,15 @@ export function CreateAccountModal({
|
||||
};
|
||||
|
||||
const onPluggyAiReset = () => {
|
||||
send('secret-set', {
|
||||
void send('secret-set', {
|
||||
name: 'pluggyai_clientId',
|
||||
value: null,
|
||||
}).then(() => {
|
||||
send('secret-set', {
|
||||
void send('secret-set', {
|
||||
name: 'pluggyai_clientSecret',
|
||||
value: null,
|
||||
}).then(() => {
|
||||
send('secret-set', {
|
||||
void send('secret-set', {
|
||||
name: 'pluggyai_itemIds',
|
||||
value: null,
|
||||
}).then(() => {
|
||||
|
||||
@@ -60,9 +60,9 @@ export function CreateEncryptionKeyModal({
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(loadGlobalPrefs());
|
||||
dispatch(loadAllFiles());
|
||||
dispatch(sync());
|
||||
void dispatch(loadGlobalPrefs());
|
||||
void dispatch(loadAllFiles());
|
||||
void dispatch(sync());
|
||||
|
||||
setLoading(false);
|
||||
close();
|
||||
@@ -174,7 +174,7 @@ export function CreateEncryptionKeyModal({
|
||||
<Form
|
||||
onSubmit={e => {
|
||||
e.preventDefault();
|
||||
onCreateKey(close);
|
||||
void onCreateKey(close);
|
||||
}}
|
||||
>
|
||||
<View style={{ alignItems: 'center' }}>
|
||||
|
||||
@@ -75,7 +75,7 @@ export function CreateLocalAccountModal() {
|
||||
{
|
||||
onSuccess: id => {
|
||||
dispatch(closeModal());
|
||||
navigate('/accounts/' + id);
|
||||
void navigate('/accounts/' + id);
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
@@ -41,7 +41,8 @@ export function EditUserAccess({
|
||||
const [availableUsers, setAvailableUsers] = useState<[string, string][]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
send('access-get-available-users', defaultUserAccess.fileId).then(data => {
|
||||
void send('access-get-available-users', defaultUserAccess.fileId).then(
|
||||
data => {
|
||||
if ('error' in data) {
|
||||
setSetError(data.error);
|
||||
} else {
|
||||
@@ -54,7 +55,8 @@ export function EditUserAccess({
|
||||
]),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
}, [defaultUserAccess.fileId]);
|
||||
|
||||
async function onSave(close: () => void) {
|
||||
@@ -80,7 +82,7 @@ export function EditUserAccess({
|
||||
button: {
|
||||
title: t('Go to login'),
|
||||
action: () => {
|
||||
dispatch(signOut());
|
||||
void dispatch(signOut());
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -102,7 +102,7 @@ function useSaveUser() {
|
||||
button: {
|
||||
title: t('Go to login'),
|
||||
action: () => {
|
||||
dispatch(signOut());
|
||||
void dispatch(signOut());
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -66,7 +66,7 @@ export function EnvelopeBudgetSummaryModal({
|
||||
month,
|
||||
amount: sheetValue,
|
||||
onSubmit: (amount, toCategoryId) => {
|
||||
onBudgetAction(month, 'transfer-available', {
|
||||
void onBudgetAction(month, 'transfer-available', {
|
||||
amount,
|
||||
month,
|
||||
category: toCategoryId,
|
||||
@@ -96,7 +96,7 @@ export function EnvelopeBudgetSummaryModal({
|
||||
showToBeBudgeted: false,
|
||||
amount: sheetValue,
|
||||
onSubmit: (amount, categoryId) => {
|
||||
onBudgetAction(month, 'cover-overbudgeted', {
|
||||
void onBudgetAction(month, 'cover-overbudgeted', {
|
||||
category: categoryId,
|
||||
amount,
|
||||
currencyCode: format.currency.code,
|
||||
@@ -122,7 +122,7 @@ export function EnvelopeBudgetSummaryModal({
|
||||
options: {
|
||||
month,
|
||||
onSubmit: amount => {
|
||||
onBudgetAction(month, 'hold', { amount });
|
||||
void onBudgetAction(month, 'hold', { amount });
|
||||
dispatch(collapseModals({ rootModalName: 'hold-buffer' }));
|
||||
},
|
||||
},
|
||||
@@ -132,7 +132,7 @@ export function EnvelopeBudgetSummaryModal({
|
||||
};
|
||||
|
||||
const onResetHoldBuffer = () => {
|
||||
onBudgetAction(month, 'reset-hold');
|
||||
void onBudgetAction(month, 'reset-hold');
|
||||
};
|
||||
|
||||
const onClick = ({ close }: { close: () => void }) => {
|
||||
|
||||
@@ -111,7 +111,7 @@ export function FixEncryptionKeyModal({
|
||||
<Form
|
||||
onSubmit={e => {
|
||||
e.preventDefault();
|
||||
onUpdateKey(close);
|
||||
void onUpdateKey(close);
|
||||
}}
|
||||
>
|
||||
<View
|
||||
|
||||
@@ -60,7 +60,7 @@ function useAvailableBanks(country: string) {
|
||||
setIsLoading(false);
|
||||
}
|
||||
|
||||
fetch();
|
||||
void fetch();
|
||||
}, [setBanks, setIsLoading, country]);
|
||||
|
||||
return {
|
||||
|
||||
@@ -142,7 +142,7 @@ export const GoCardlessInitialiseModal = ({
|
||||
variant="primary"
|
||||
isLoading={isLoading}
|
||||
onPress={() => {
|
||||
onSubmit(close);
|
||||
void onSubmit(close);
|
||||
}}
|
||||
>
|
||||
<Trans>Save and continue</Trans>
|
||||
|
||||
@@ -413,7 +413,7 @@ export function ImportTransactionsModal({
|
||||
importNotes,
|
||||
});
|
||||
|
||||
parse(originalFileName, parseOptions);
|
||||
void parse(originalFileName, parseOptions);
|
||||
}, [
|
||||
originalFileName,
|
||||
delimiter,
|
||||
@@ -471,7 +471,7 @@ export function ImportTransactionsModal({
|
||||
importNotes,
|
||||
});
|
||||
|
||||
parse(res[0], parseOptions);
|
||||
void parse(res[0], parseOptions);
|
||||
}
|
||||
|
||||
function onUpdateFields(field, name) {
|
||||
@@ -656,7 +656,7 @@ export function ImportTransactionsModal({
|
||||
{
|
||||
onSuccess: async didChange => {
|
||||
if (didChange) {
|
||||
queryClient.invalidateQueries(payeeQueries.list());
|
||||
void queryClient.invalidateQueries(payeeQueries.list());
|
||||
}
|
||||
|
||||
if (onImported) {
|
||||
@@ -749,7 +749,7 @@ export function ImportTransactionsModal({
|
||||
return;
|
||||
}
|
||||
|
||||
onImportPreview();
|
||||
void onImportPreview();
|
||||
}, [loadingState, parsedTransactions.length]);
|
||||
|
||||
const headers: ComponentProps<typeof TableHeader>['headers'] = [
|
||||
@@ -1133,7 +1133,7 @@ export function ImportTransactionsModal({
|
||||
isDisabled={count === 0}
|
||||
isLoading={loadingState === 'importing'}
|
||||
onPress={() => {
|
||||
onImport(close);
|
||||
void onImport(close);
|
||||
}}
|
||||
>
|
||||
<Trans count={count}>Import {{ count }} transactions</Trans>
|
||||
|
||||
@@ -69,7 +69,7 @@ export function LoadBackupModal({
|
||||
|
||||
useEffect(() => {
|
||||
if (budgetIdToLoad) {
|
||||
send('backups-get', { id: budgetIdToLoad }).then(setBackups);
|
||||
void send('backups-get', { id: budgetIdToLoad }).then(setBackups);
|
||||
}
|
||||
}, [budgetIdToLoad]);
|
||||
|
||||
@@ -119,7 +119,7 @@ export function LoadBackupModal({
|
||||
variant="primary"
|
||||
onPress={() => {
|
||||
if (budgetIdToLoad && latestBackup.id) {
|
||||
dispatch(
|
||||
void dispatch(
|
||||
loadBackup({
|
||||
budgetId: budgetIdToLoad,
|
||||
backupId: latestBackup.id,
|
||||
@@ -165,7 +165,7 @@ export function LoadBackupModal({
|
||||
backups={previousBackups}
|
||||
onSelect={id => {
|
||||
if (budgetIdToLoad && id) {
|
||||
dispatch(
|
||||
void dispatch(
|
||||
loadBackup({ budgetId: budgetIdToLoad, backupId: id }),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ export function MergeUnusedPayeesModal({
|
||||
autoFocus
|
||||
style={{ marginRight: 10 }}
|
||||
onPress={() => {
|
||||
onMerge(targetPayee);
|
||||
void onMerge(targetPayee);
|
||||
close();
|
||||
}}
|
||||
>
|
||||
@@ -207,7 +207,7 @@ export function MergeUnusedPayeesModal({
|
||||
<Button
|
||||
style={{ marginRight: 10 }}
|
||||
onPress={() => {
|
||||
onMergeAndCreateRule(targetPayee);
|
||||
void onMergeAndCreateRule(targetPayee);
|
||||
close();
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -21,7 +21,7 @@ export function OutOfSyncMigrationsModal() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const closeBudgetAndModal = (close: () => void) => {
|
||||
dispatch(closeBudget());
|
||||
void dispatch(closeBudget());
|
||||
close();
|
||||
};
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ export const PluggyAiInitialiseModal = ({
|
||||
variant="primary"
|
||||
isLoading={isLoading}
|
||||
onPress={() => {
|
||||
onSubmit(close);
|
||||
void onSubmit(close);
|
||||
}}
|
||||
>
|
||||
<Trans>Save and continue</Trans>
|
||||
|
||||
@@ -106,7 +106,7 @@ export const SimpleFinInitialiseModal = ({
|
||||
autoFocus
|
||||
isLoading={isLoading}
|
||||
onPress={() => {
|
||||
onSubmit(close);
|
||||
void onSubmit(close);
|
||||
}}
|
||||
>
|
||||
<Trans>Save and continue</Trans>
|
||||
|
||||
@@ -52,7 +52,7 @@ export function TransferOwnership({
|
||||
const [isTransferring, setIsTransferring] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
send('users-get').then(
|
||||
void send('users-get').then(
|
||||
(data: Awaited<ReturnType<Handlers['users-get']>>) => {
|
||||
if (!data) {
|
||||
setAvailableUsers([]);
|
||||
|
||||
@@ -36,7 +36,7 @@ export function UnmigrateBudgetAutomationsModal({
|
||||
|
||||
useEffect(() => {
|
||||
let mounted = true;
|
||||
(async () => {
|
||||
void (async () => {
|
||||
try {
|
||||
const text: string = await send(
|
||||
'budget/render-note-templates',
|
||||
|
||||
@@ -49,7 +49,7 @@ export function DuplicateFileModal({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
void (async () => {
|
||||
setNewName(await uniqueBudgetName(file.name + fileEndingTranslation));
|
||||
})();
|
||||
}, [file.name, fileEndingTranslation]);
|
||||
|
||||
@@ -156,7 +156,7 @@ export function FilesSettingsModal() {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
function closeModal(close: () => void) {
|
||||
dispatch(loadAllFiles());
|
||||
void dispatch(loadAllFiles());
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ export function ImportActualModal() {
|
||||
setError(null);
|
||||
try {
|
||||
await dispatch(importBudget({ filepath: res[0], type: 'actual' }));
|
||||
navigate('/budget');
|
||||
void navigate('/budget');
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
|
||||
@@ -44,7 +44,7 @@ export function ImportYNAB4Modal() {
|
||||
setError(null);
|
||||
try {
|
||||
await dispatch(importBudget({ filepath: res[0], type: 'ynab4' }));
|
||||
navigate('/budget');
|
||||
void navigate('/budget');
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
|
||||
@@ -54,7 +54,7 @@ export function ImportYNAB5Modal() {
|
||||
setError(null);
|
||||
try {
|
||||
await dispatch(importBudget({ filepath: res[0], type: 'ynab5' }));
|
||||
navigate('/budget');
|
||||
void navigate('/budget');
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
|
||||
@@ -69,7 +69,7 @@ export function ManagePayeesWithData({
|
||||
|
||||
const lastUndoEvent = undo.getUndoState('undoEvent');
|
||||
if (lastUndoEvent) {
|
||||
onUndo(lastUndoEvent);
|
||||
void onUndo(lastUndoEvent);
|
||||
}
|
||||
|
||||
return listen('undo-event', onUndo);
|
||||
|
||||
@@ -88,7 +88,7 @@ export function PayeeMenu({
|
||||
onDelete();
|
||||
break;
|
||||
case 'merge':
|
||||
onMerge();
|
||||
void onMerge();
|
||||
break;
|
||||
case 'favorite':
|
||||
onFavorite();
|
||||
|
||||
@@ -35,7 +35,7 @@ export function DashboardSelector({
|
||||
{ name: defaultName },
|
||||
{
|
||||
onSuccess: id => {
|
||||
navigate(`/reports/${id}`);
|
||||
void navigate(`/reports/${id}`);
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -97,9 +97,9 @@ export function DashboardSelector({
|
||||
slot="close"
|
||||
onMenuSelect={item => {
|
||||
if (item === 'add-new') {
|
||||
handleAddDashboard();
|
||||
void handleAddDashboard();
|
||||
} else {
|
||||
navigate(`/reports/${item}`);
|
||||
void navigate(`/reports/${item}`);
|
||||
}
|
||||
setMenuOpen(false);
|
||||
}}
|
||||
|
||||
@@ -308,7 +308,7 @@ export function Overview({ dashboard }: OverviewProps) {
|
||||
}),
|
||||
} satisfies ExportImportDashboard;
|
||||
|
||||
window.Actual.saveFile(
|
||||
void window.Actual.saveFile(
|
||||
JSON.stringify(data, null, 2),
|
||||
'dashboard.json',
|
||||
t('Export Dashboard'),
|
||||
@@ -442,7 +442,7 @@ export function Overview({ dashboard }: OverviewProps) {
|
||||
const nextDashboard = dashboardPages.find(d => d.id !== id);
|
||||
// NOTE: This should hold since invariant dashboard_pages > 1
|
||||
if (nextDashboard) {
|
||||
navigate(`/reports/${nextDashboard.id}`);
|
||||
void navigate(`/reports/${nextDashboard.id}`);
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -533,7 +533,7 @@ export function Overview({ dashboard }: OverviewProps) {
|
||||
slot="close"
|
||||
onMenuSelect={item => {
|
||||
if (item === 'custom-report') {
|
||||
navigate('/reports/custom');
|
||||
void navigate('/reports/custom');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -658,16 +658,16 @@ export function Overview({ dashboard }: OverviewProps) {
|
||||
onMenuSelect={item => {
|
||||
switch (item) {
|
||||
case 'reset':
|
||||
onResetDashboard();
|
||||
void onResetDashboard();
|
||||
break;
|
||||
case 'export':
|
||||
onExport();
|
||||
break;
|
||||
case 'import':
|
||||
onImport();
|
||||
void onImport();
|
||||
break;
|
||||
case 'delete':
|
||||
onDeleteDashboard(dashboard.id);
|
||||
void onDeleteDashboard(dashboard.id);
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
|
||||
@@ -20,7 +20,7 @@ export function ReportsDashboardRouter() {
|
||||
// Redirect to first dashboard if no dashboardId in URL
|
||||
useEffect(() => {
|
||||
if (!dashboardId && !isPending && dashboardPages.length > 0) {
|
||||
navigate(`/reports/${dashboardPages[0].id}`, { replace: true });
|
||||
void navigate(`/reports/${dashboardPages[0].id}`, { replace: true });
|
||||
}
|
||||
}, [dashboardId, isPending, dashboardPages, navigate]);
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ export function SaveReport({
|
||||
case 'update-report':
|
||||
setErr('');
|
||||
setMenuOpen(false);
|
||||
onAddUpdate({ menuChoice: item });
|
||||
void onAddUpdate({ menuChoice: item });
|
||||
break;
|
||||
case 'save-report':
|
||||
setErr('');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user