From 77795c63e3716519613efc747a098d854136b5e7 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins <matiss@mja.lv> Date: Mon, 2 Jan 2023 13:08:00 +0000 Subject: [PATCH] chore: remove unused variables --- .../src/components/AnimatedRefresh.js | 5 ---- packages/desktop-client/src/components/App.js | 7 ++--- .../src/components/FinancesApp.js | 24 --------------- .../src/components/ManageRules.js | 10 +------ .../src/components/Notifications.js | 3 +- .../desktop-client/src/components/Settings.js | 10 ++----- .../src/components/accounts/Account.js | 9 ------ .../accounts/SimpleTransactionsTable.js | 1 - .../components/accounts/TransactionList.js | 6 +--- .../components/accounts/TransactionsTable.js | 5 ---- .../components/budget/MonthCountSelector.js | 3 -- .../src/components/budget/index.js | 3 -- .../components/manager/subscribe/Bootstrap.js | 2 -- .../manager/subscribe/ChangePassword.js | 2 -- .../src/components/manager/subscribe/Login.js | 2 -- .../modals/ConfirmCategoryDelete.js | 2 +- .../components/modals/CreateEncryptionKey.js | 1 - .../src/components/modals/EditRule.js | 2 +- .../components/payees/ManagePayeesWithData.js | 1 - .../src/components/reports/CashFlow.js | 4 +-- .../src/components/reports/NetWorth.js | 2 -- .../components/schedules/DiscoverSchedules.js | 5 +--- .../src/components/schedules/EditSchedule.js | 7 ++--- .../src/components/schedules/LinkSchedule.js | 4 --- packages/desktop-client/src/global-events.js | 10 ++----- packages/desktop-client/src/index.js | 30 +------------------ packages/desktop-client/src/plaid.js | 2 +- .../nodejs-project/sample-main.js | 22 +++++++------- 28 files changed, 30 insertions(+), 154 deletions(-) diff --git a/packages/desktop-client/src/components/AnimatedRefresh.js b/packages/desktop-client/src/components/AnimatedRefresh.js index 175529f8a..c80445d4a 100644 --- a/packages/desktop-client/src/components/AnimatedRefresh.js +++ b/packages/desktop-client/src/components/AnimatedRefresh.js @@ -10,11 +10,6 @@ let spin = css.keyframes({ '100%': { transform: 'rotateZ(360deg)' } }); -let spinStop = css.keyframes({ - '0%': { transform: 'rotateZ(0deg)' }, - '100%': { transform: 'rotateZ(180deg)' } -}); - export default function AnimatedRefresh({ animating, iconStyle }) { return ( <View diff --git a/packages/desktop-client/src/components/App.js b/packages/desktop-client/src/components/App.js index 1698d20e2..39bef1d0f 100644 --- a/packages/desktop-client/src/components/App.js +++ b/packages/desktop-client/src/components/App.js @@ -40,7 +40,7 @@ class App extends React.Component { } // Load any global prefs - let globalPrefs = await this.props.loadGlobalPrefs(); + await this.props.loadGlobalPrefs(); // Open the last opened budget, if any const budgetId = await send('get-last-opened-backup'); @@ -88,7 +88,7 @@ class App extends React.Component { } render() { - const { budgetId, loadingText, showingTutorial } = this.props; + const { budgetId, loadingText } = this.props; const { fatalError, initializing, hiddenScrollbars } = this.state; return ( @@ -136,8 +136,7 @@ export default connect( state => ({ budgetId: state.prefs.local && state.prefs.local.id, cloudFileId: state.prefs.local && state.prefs.local.cloudFileId, - loadingText: state.app.loadingText, - showingTutorial: state.tutorial.stage !== null + loadingText: state.app.loadingText }), actions )(App); diff --git a/packages/desktop-client/src/components/FinancesApp.js b/packages/desktop-client/src/components/FinancesApp.js index bdc6f4482..f34f775b5 100644 --- a/packages/desktop-client/src/components/FinancesApp.js +++ b/packages/desktop-client/src/components/FinancesApp.js @@ -40,26 +40,6 @@ import Titlebar, { TitlebarProvider } from './Titlebar'; import FixSplitsTool from './tools/FixSplitsTool'; // import Debugger from './Debugger'; -function URLBar() { - let location = useLocation(); - - return ( - <View - style={{ - position: 'absolute', - bottom: 0, - right: 0, - margin: 15, - backgroundColor: colors.n9, - padding: 8, - borderRadius: 6 - }} - > - {location.pathname} - </View> - ); -} - function PageRoute({ path, component: Component }) { return ( <Route @@ -246,12 +226,8 @@ class FinancesApp extends React.Component { > <Notifications /> <BankSyncStatus /> - <StackedRoutes /> - {/*window.Actual.IS_DEV && <Debugger />*/} - {/*window.Actual.IS_DEV && <URLBar />*/} - <Modals history={this.history} /> </div> </div> diff --git a/packages/desktop-client/src/components/ManageRules.js b/packages/desktop-client/src/components/ManageRules.js index 37c8bc0f7..e621937d9 100644 --- a/packages/desktop-client/src/components/ManageRules.js +++ b/packages/desktop-client/src/components/ManageRules.js @@ -13,15 +13,11 @@ import { send } from 'loot-core/src/platform/client/fetch'; import * as undo from 'loot-core/src/platform/client/undo'; import { getMonthYearFormat } from 'loot-core/src/shared/months'; import { mapField, friendlyOp } from 'loot-core/src/shared/rules'; -import { - extractScheduleConds, - getRecurringDescription -} from 'loot-core/src/shared/schedules'; +import { getRecurringDescription } from 'loot-core/src/shared/schedules'; import { integerToCurrency } from 'loot-core/src/shared/util'; import { View, Text, - Modal, Button, Stack, ExternalLink @@ -43,8 +39,6 @@ import useSelected, { import { colors } from 'loot-design/src/style'; import ArrowRight from 'loot-design/src/svg/RightArrow2'; -import { Page } from './Page'; - let SchedulesQuery = liveQueryContext(q('schedules').select('*')); export function Value({ @@ -294,7 +288,6 @@ let Rule = React.memo( onEdit, onEditRule }) => { - let dispatch = useDispatch(); let dispatchSelected = useSelectedDispatch(); let borderColor = selected ? colors.b8 : colors.border; let backgroundFocus = hovered || focusedField === 'select'; @@ -580,7 +573,6 @@ export default function ManageRules({ setRules(rules => { let newIdx = newRules.findIndex(rule => rule.id === newRule.id); - let oldIdx = rules.findIndex(rule => rule.id === newRule.id); if (newIdx > rules.length) { return newRules.slice(0, newIdx + 75); diff --git a/packages/desktop-client/src/components/Notifications.js b/packages/desktop-client/src/components/Notifications.js index c8ae15c03..333570b0a 100644 --- a/packages/desktop-client/src/components/Notifications.js +++ b/packages/desktop-client/src/components/Notifications.js @@ -27,7 +27,7 @@ function compileMessage(message, actions, setLoading, onRemove) { {parts.map((part, idx) => { let match = part.match(/\[([^\]]*)\]\(([^)]*)\)/); if (match) { - let [_, text, href] = match; + let [, text, href] = match; if (href[0] === '#') { let actionName = href.slice(1); @@ -66,7 +66,6 @@ function compileMessage(message, actions, setLoading, onRemove) { function Notification({ notification, onRemove }) { let { - id, type, title, message, diff --git a/packages/desktop-client/src/components/Settings.js b/packages/desktop-client/src/components/Settings.js index e93656401..d699e31c4 100644 --- a/packages/desktop-client/src/components/Settings.js +++ b/packages/desktop-client/src/components/Settings.js @@ -1,6 +1,5 @@ import React, { useState, useEffect, useRef } from 'react'; import { connect } from 'react-redux'; -import { Route, Switch, Redirect } from 'react-router-dom'; import { css } from 'glamor'; @@ -14,11 +13,9 @@ import { Text, Button, Link, - ButtonWithLoading, - AnchorLink + ButtonWithLoading } from 'loot-design/src/components/common'; -import { styles, colors } from 'loot-design/src/style'; -import ExpandArrow from 'loot-design/src/svg/ExpandArrow'; +import { colors } from 'loot-design/src/style'; import useServerVersion from '../hooks/useServerVersion'; import { Page } from './Page'; @@ -352,7 +349,7 @@ class Settings extends React.Component { } render() { - let { prefs, globalPrefs, localServerURL, userData, match } = this.props; + let { prefs, globalPrefs, userData } = this.props; return ( <Page title="Settings"> @@ -380,7 +377,6 @@ export default connect( state => ({ prefs: state.prefs.local, globalPrefs: state.prefs.global, - localServerURL: state.account.localServerURL, userData: state.user.data }), actions diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js index 11e0f511b..a8ee8a1d6 100644 --- a/packages/desktop-client/src/components/accounts/Account.js +++ b/packages/desktop-client/src/components/accounts/Account.js @@ -489,10 +489,6 @@ function SelectedTransactionsButton({ ); }, [types.preview, selectedItems, getTransaction]); - function getRealTransactions() { - return [...selectedItems].filter(id => !isPreviewId(id)); - } - return ( <SelectedItemsButton name="transactions" @@ -582,7 +578,6 @@ function SelectedTransactionsButton({ onUnlink([...selectedItems]); break; default: - let field = name; onEdit(name, [...selectedItems]); } }} @@ -1101,7 +1096,6 @@ class AccountInternal extends React.PureComponent { }; makeRootQuery = () => { - let { transactions } = this.state; let locationState = this.props.location.state; let accountId = this.props.accountId; @@ -1625,14 +1619,12 @@ class AccountInternal extends React.PureComponent { accounts, categoryGroups, payees, - match, syncEnabled, dateFormat, addNotification, accountsSyncing, replaceModal, showExtraBalances, - expandSplits, accountId } = this.props; let { @@ -1640,7 +1632,6 @@ class AccountInternal extends React.PureComponent { loading, workingHard, reconcileAmount, - transactionCount, transactionsFiltered, editingName, showBalances, diff --git a/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js b/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js index 819b3ca19..ca04a19ff 100644 --- a/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js +++ b/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js @@ -54,7 +54,6 @@ const TransactionRow = React.memo(function TransactionRow({ let a = getAccountsById(accounts)[transaction.account]; let dispatchSelected = useSelectedDispatch(); - let schedule = transaction.schedule; return ( <Row> diff --git a/packages/desktop-client/src/components/accounts/TransactionList.js b/packages/desktop-client/src/components/accounts/TransactionList.js index eb030b317..370222996 100644 --- a/packages/desktop-client/src/components/accounts/TransactionList.js +++ b/packages/desktop-client/src/components/accounts/TransactionList.js @@ -1,5 +1,4 @@ import React, { useRef, useEffect, useCallback, useLayoutEffect } from 'react'; -import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router'; import { send } from 'loot-core/src/platform/client/fetch'; @@ -14,8 +13,6 @@ import { getChangedValues, applyChanges } from 'loot-core/src/shared/util'; import { TransactionTable } from './TransactionsTable'; -const uuid = require('loot-core/src/platform/uuid'); - // When data changes, there are two ways to update the UI: // // * Optimistic updates: we apply the needed updates to local data @@ -81,8 +78,7 @@ export default function TransactionList({ onCloseAddTransaction, onCreatePayee }) { - let dispatch = useDispatch(); - let table = useRef(); + // let table = useRef(); let transactionsLatest = useRef(); let scrollTo = useRef(); let history = useHistory(); diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.js b/packages/desktop-client/src/components/accounts/TransactionsTable.js index 2d25cbe84..aa5eef5e0 100644 --- a/packages/desktop-client/src/components/accounts/TransactionsTable.js +++ b/packages/desktop-client/src/components/accounts/TransactionsTable.js @@ -68,8 +68,6 @@ import Hyperlink2 from 'loot-design/src/svg/v2/Hyperlink2'; import { getStatusProps } from '../schedules/StatusBadge'; -let TABLE_BACKGROUND_COLOR = colors.n11; - function getDisplayValue(obj, name) { return obj ? obj[name] : ''; } @@ -132,7 +130,6 @@ function deserializeTransaction(transaction, originalTransaction, dateFormat) { function getParentTransaction(transactions, fromIndex) { let trans = transactions[fromIndex]; - let parent; let parentIdx = fromIndex; while (parentIdx >= 0) { if (transactions[parentIdx].id === trans.parent_id) { @@ -479,7 +476,6 @@ function CellWithScheduleIcon({ scheduleId, children }) { marginRight: 3, color: 'inherit' }; - let Icon = recurring ? ArrowsSynchronize : CalendarIcon; return ( <View style={{ flex: 1, flexDirection: 'row', alignItems: 'stretch' }}> @@ -1514,7 +1510,6 @@ export let TransactionTable = React.forwardRef((props, ref) => { let [_, forceRerender] = useState({}); let selectedItems = useSelectedItems(); - let dispatchSelected = useSelectedDispatch(); useLayoutEffect(() => { latestState.current = { diff --git a/packages/desktop-client/src/components/budget/MonthCountSelector.js b/packages/desktop-client/src/components/budget/MonthCountSelector.js index b94494831..e21d3efbc 100644 --- a/packages/desktop-client/src/components/budget/MonthCountSelector.js +++ b/packages/desktop-client/src/components/budget/MonthCountSelector.js @@ -17,9 +17,6 @@ function Calendar({ color, onClick }) { export function MonthCountSelector({ maxMonths, onChange }) { let { displayMax } = useBudgetMonthCount(); - let style = { width: 15, height: 15, color: colors.n8 }; - let activeStyle = { color: colors.n5 }; - // It doesn't make sense to show anything if we can only fit one // month if (displayMax <= 1) { diff --git a/packages/desktop-client/src/components/budget/index.js b/packages/desktop-client/src/components/budget/index.js index 5a733959a..b0001d90f 100644 --- a/packages/desktop-client/src/components/budget/index.js +++ b/packages/desktop-client/src/components/budget/index.js @@ -320,9 +320,6 @@ class Budget extends React.PureComponent { }; onShowActivity = (categoryName, categoryId, month) => { - const after = `${month}-01`; - const before = `${month}-31`; - this.props.history.push({ pathname: '/accounts', state: { diff --git a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js index 00d0cdd89..8da5844cf 100644 --- a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js +++ b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js @@ -1,6 +1,5 @@ import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; -import { useHistory } from 'react-router-dom'; import { createBudget } from 'loot-core/src/client/actions/budgets'; import { loggedIn } from 'loot-core/src/client/actions/user'; @@ -13,7 +12,6 @@ import { ConfirmPasswordForm } from './ConfirmPasswordForm'; export default function Bootstrap() { let dispatch = useDispatch(); - let history = useHistory(); let [error, setError] = useState(null); let { checked } = useBootstrapped(); diff --git a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js index abda7d46d..d64cfb698 100644 --- a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js +++ b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js @@ -1,5 +1,4 @@ import React, { useState } from 'react'; -import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { send } from 'loot-core/src/platform/client/fetch'; @@ -10,7 +9,6 @@ import { Title } from './common'; import { ConfirmPasswordForm } from './ConfirmPasswordForm'; export default function ChangePassword() { - let dispatch = useDispatch(); let history = useHistory(); let [error, setError] = useState(null); let [msg, setMessage] = useState(null); diff --git a/packages/desktop-client/src/components/manager/subscribe/Login.js b/packages/desktop-client/src/components/manager/subscribe/Login.js index b0629a92d..1c76a45d1 100644 --- a/packages/desktop-client/src/components/manager/subscribe/Login.js +++ b/packages/desktop-client/src/components/manager/subscribe/Login.js @@ -1,6 +1,5 @@ import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; -import { useHistory } from 'react-router-dom'; import { createBudget } from 'loot-core/src/client/actions/budgets'; import { loggedIn } from 'loot-core/src/client/actions/user'; @@ -17,7 +16,6 @@ import { useBootstrapped, Title, Input } from './common'; export default function Login() { let dispatch = useDispatch(); - let history = useHistory(); let [password, setPassword] = useState(''); let [loading, setLoading] = useState(false); let [error, setError] = useState(null); diff --git a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js index d737bf1e4..6d391625b 100644 --- a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js +++ b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js @@ -22,7 +22,7 @@ class ConfirmCategoryDelete extends React.Component { onDelete = () => { let { transferCategory } = this.state; - let { category, group, onDelete } = this.props; + let { onDelete } = this.props; if (!transferCategory) { this.setState({ error: 'required-transfer' }); diff --git a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js b/packages/desktop-client/src/components/modals/CreateEncryptionKey.js index 34a2cf3ec..5f76b0a99 100644 --- a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js +++ b/packages/desktop-client/src/components/modals/CreateEncryptionKey.js @@ -23,7 +23,6 @@ export default function CreateEncryptionKey({ budgetId, options = {} }) { - let [enabling, setEnabling] = useState(false); let [password, setPassword] = useState(''); let [loading, setLoading] = useState(false); let [error, setError] = useState(''); diff --git a/packages/desktop-client/src/components/modals/EditRule.js b/packages/desktop-client/src/components/modals/EditRule.js index abfdd1ea1..bdef8cbff 100644 --- a/packages/desktop-client/src/components/modals/EditRule.js +++ b/packages/desktop-client/src/components/modals/EditRule.js @@ -176,7 +176,7 @@ export function ConditionEditor({ onDelete, onAdd }) { - let { field, op, value, type, options, error, inputKey } = condition; + let { field, op, value, type, options, error } = condition; if (field === 'amount' && options) { if (options.inflow) { diff --git a/packages/desktop-client/src/components/payees/ManagePayeesWithData.js b/packages/desktop-client/src/components/payees/ManagePayeesWithData.js index ade382cb1..8d2f05e19 100644 --- a/packages/desktop-client/src/components/payees/ManagePayeesWithData.js +++ b/packages/desktop-client/src/components/payees/ManagePayeesWithData.js @@ -3,7 +3,6 @@ import { connect } from 'react-redux'; import * as actions from 'loot-core/src/client/actions'; import { send, listen } from 'loot-core/src/platform/client/fetch'; -import * as undo from 'loot-core/src/platform/client/undo'; import { applyChanges } from 'loot-core/src/shared/util'; import { ManagePayees } from 'loot-design/src/components/payees'; diff --git a/packages/desktop-client/src/components/reports/CashFlow.js b/packages/desktop-client/src/components/reports/CashFlow.js index ec99a1a4c..254c80891 100644 --- a/packages/desktop-client/src/components/reports/CashFlow.js +++ b/packages/desktop-client/src/components/reports/CashFlow.js @@ -22,7 +22,6 @@ import useReport from './useReport'; import { useArgsMemo } from './util'; function CashFlow() { - const [earliestMonth, setEarliestMonth] = useState(null); const [allMonths, setAllMonths] = useState(null); const [start, setStart] = useState( monthUtils.subMonths(monthUtils.currentMonth(), 30) @@ -57,7 +56,6 @@ function CashFlow() { })) .reverse(); - setEarliestMonth(earliestMonth); setAllMonths(allMonths); } run(); @@ -84,7 +82,7 @@ function CashFlow() { return null; } - const { graphData, balance, totalChange, totalExpenses, totalIncome } = data; + const { graphData, totalExpenses, totalIncome } = data; return ( <View style={[styles.page, { minWidth: 650, overflow: 'hidden' }]}> diff --git a/packages/desktop-client/src/components/reports/NetWorth.js b/packages/desktop-client/src/components/reports/NetWorth.js index 9a17a1e1b..2bbb2dccb 100644 --- a/packages/desktop-client/src/components/reports/NetWorth.js +++ b/packages/desktop-client/src/components/reports/NetWorth.js @@ -19,7 +19,6 @@ import useReport from './useReport'; import { fromDateRepr, useArgsMemo } from './util'; function NetWorth({ accounts }) { - const [earliestMonth, setEarliestMonth] = useState(null); const [allMonths, setAllMonths] = useState(null); const [start, setStart] = useState( monthUtils.subMonths(monthUtils.currentMonth(), 5) @@ -55,7 +54,6 @@ function NetWorth({ accounts }) { })) .reverse(); - setEarliestMonth(earliestMonth); setAllMonths(allMonths); } run(); diff --git a/packages/desktop-client/src/components/schedules/DiscoverSchedules.js b/packages/desktop-client/src/components/schedules/DiscoverSchedules.js index cd161bbda..ac8dfc3a6 100644 --- a/packages/desktop-client/src/components/schedules/DiscoverSchedules.js +++ b/packages/desktop-client/src/components/schedules/DiscoverSchedules.js @@ -1,14 +1,12 @@ import React, { useState, useEffect } from 'react'; -import { useLocation, useHistory } from 'react-router-dom'; +import { useHistory } from 'react-router-dom'; -import Platform from 'loot-core/src/client/platform'; import q, { runQuery } from 'loot-core/src/client/query-helpers'; import { send } from 'loot-core/src/platform/client/fetch'; import { getRecurringDescription } from 'loot-core/src/shared/schedules'; import { View, Stack, - Button, ButtonWithLoading, P } from 'loot-design/src/components/common'; @@ -133,7 +131,6 @@ export default function DiscoverSchedules() { }, []); async function onCreate() { - let items = selectedInst.items; let selected = schedules.filter(s => selectedInst.items.has(s.id)); setCreating(true); diff --git a/packages/desktop-client/src/components/schedules/EditSchedule.js b/packages/desktop-client/src/components/schedules/EditSchedule.js index e8fcb19c4..d3f3dfb66 100644 --- a/packages/desktop-client/src/components/schedules/EditSchedule.js +++ b/packages/desktop-client/src/components/schedules/EditSchedule.js @@ -26,7 +26,7 @@ import { colors } from 'loot-design/src/style'; import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable'; import { OpSelect } from '../modals/EditRule'; -import { Page, usePageType } from '../Page'; +import { Page } from '../Page'; import { AmountInput, BetweenAmountInput } from '../util/AmountInput'; function mergeFields(defaults, initial) { @@ -92,8 +92,6 @@ export default function ScheduleDetails() { return state.prefs.local.dateFormat || 'MM/dd/yyyy'; }); - let pageType = usePageType(); - let [state, dispatch] = useReducer( (state, action) => { switch (action.type) { @@ -251,7 +249,6 @@ export default function ScheduleDetails() { useEffect(() => { async function run() { let date = state.fields.date; - let dates = null; if (date == null) { dispatch({ type: 'set-upcoming-dates', dates: null }); @@ -297,7 +294,7 @@ export default function ScheduleDetails() { let unsubscribe; if (state.schedule && state.transactionsMode === 'matched') { - let { error, conditions } = updateScheduleConditions( + let { conditions } = updateScheduleConditions( state.schedule, state.fields ); diff --git a/packages/desktop-client/src/components/schedules/LinkSchedule.js b/packages/desktop-client/src/components/schedules/LinkSchedule.js index 07d1b4607..6fbf02598 100644 --- a/packages/desktop-client/src/components/schedules/LinkSchedule.js +++ b/packages/desktop-client/src/components/schedules/LinkSchedule.js @@ -1,5 +1,4 @@ import React, { useCallback } from 'react'; -import { useSelector } from 'react-redux'; import { useLocation, useHistory } from 'react-router-dom'; import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; @@ -15,9 +14,6 @@ export default function ScheduleLink() { let scheduleData = useSchedules( useCallback(query => query.filter({ completed: false }), []) ); - let dateFormat = useSelector(state => { - return state.prefs.local.dateFormat || 'MM/dd/yyyy'; - }); if (scheduleData == null) { return null; diff --git a/packages/desktop-client/src/global-events.js b/packages/desktop-client/src/global-events.js index d465c39ae..9e81de522 100644 --- a/packages/desktop-client/src/global-events.js +++ b/packages/desktop-client/src/global-events.js @@ -1,5 +1,5 @@ import * as sharedListeners from 'loot-core/src/client/shared-listeners'; -import { send, listen } from 'loot-core/src/platform/client/fetch'; +import { listen } from 'loot-core/src/platform/client/fetch'; import * as undo from 'loot-core/src/platform/client/undo'; export function handleGlobalEvents(actions, store) { @@ -45,12 +45,6 @@ export function handleGlobalEvents(actions, store) { } }); - async function onManage() { - let tempId = await send('make-user-temp-id'); - let url = 'https://actualbudget.com/account?tempId=' + tempId; - window.Actual.openURLInBrowser(url); - } - // This is experimental: we sync data locally automatically when // data changes from the backend listen('sync-event', async ({ type, tables }) => { @@ -82,7 +76,7 @@ export function handleGlobalEvents(actions, store) { sharedListeners.listenForSyncEvent(actions, store); listen('undo-event', undoState => { - let { messages, tables, undoTag } = undoState; + let { tables, undoTag } = undoState; let promises = []; if ( diff --git a/packages/desktop-client/src/index.js b/packages/desktop-client/src/index.js index b22f4ddf9..0cea1e10e 100644 --- a/packages/desktop-client/src/index.js +++ b/packages/desktop-client/src/index.js @@ -31,30 +31,6 @@ import { handleGlobalEvents } from './global-events'; // focus outline appear from keyboard events. require('focus-visible'); -function lightweightStringify(obj) { - return JSON.stringify(obj, function(k, v) { - return k ? '' + v : v; - }); -} - -function log() { - return next => action => { - if (window.Actual.IS_DEV) { - console.log(action); - } - - if (window.SentryClient) { - window.SentryClient.addBreadcrumb({ - message: lightweightStringify(action).slice(0, 500), - category: 'redux', - level: 'info' - }); - } - - return next(action); - }; -} - const appReducer = combineReducers(reducers); function rootReducer(state, action) { if (action.type === constants.CLOSE_BUDGET) { @@ -77,11 +53,7 @@ function rootReducer(state, action) { return appReducer(state, action); } -const store = createStore( - rootReducer, - undefined, - applyMiddleware(thunk /*log*/) -); +const store = createStore(rootReducer, undefined, applyMiddleware(thunk)); const boundActions = bindActionCreators(actions, store.dispatch); // Listen for global events from the server or main process diff --git a/packages/desktop-client/src/plaid.js b/packages/desktop-client/src/plaid.js index 6fd85a931..fdaeae4a1 100644 --- a/packages/desktop-client/src/plaid.js +++ b/packages/desktop-client/src/plaid.js @@ -35,7 +35,7 @@ export async function authorizeBank(pushModal, { upgradingId } = {}) { } export async function reauthorizeBank(pushModal, bankId, onSuccess) { - let { error, linkToken } = await send('make-plaid-public-token', { + let { linkToken } = await send('make-plaid-public-token', { bankId }); diff --git a/packages/mobile/nodejs-assets/nodejs-project/sample-main.js b/packages/mobile/nodejs-assets/nodejs-project/sample-main.js index 649b9d6c1..ba11bd5b8 100644 --- a/packages/mobile/nodejs-assets/nodejs-project/sample-main.js +++ b/packages/mobile/nodejs-assets/nodejs-project/sample-main.js @@ -1,12 +1,12 @@ -// Rename this sample file to main.js to use on your project. -// The main.js file will be overwritten in updates/reinstalls. - -var rn_bridge = require('rn-bridge'); - -// Echo every message received from react-native. -rn_bridge.channel.on('message', (msg) => { - rn_bridge.channel.send(msg); -} ); - -// Inform react-native node is initialized. +// Rename this sample file to main.js to use on your project. +// The main.js file will be overwritten in updates/reinstalls. + +var rn_bridge = require('rn-bridge'); + +// Echo every message received from react-native. +rn_bridge.channel.on('message', (msg) => { + rn_bridge.channel.send(msg); +} ); + +// Inform react-native node is initialized. rn_bridge.channel.send("Node was initialized."); \ No newline at end of file -- GitLab