diff --git a/packages/desktop-client/src/components/AnimatedRefresh.js b/packages/desktop-client/src/components/AnimatedRefresh.js index 175529f8a6c11cc00b91b8030f5b89c13de4cd5c..c80445d4a15bd77f514c8aaf450adaf727b3520d 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 1698d20e22cec6318b3e005fa70eef7658fa0600..39bef1d0f13ae532c8f5bbe9f7e657a3075fd3db 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 bdc6f44822249a2565f7d06c66d9853e7a95a8bd..f34f775b565d3ad4acd24ac1fb0843f4011f8c1c 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 37c8bc0f790c18c0ca8d1343f9fdfdd66772d8a8..e621937d9a74909bcd4673809b3ba02f7757d099 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 c8ae15c0369904aa97ce2758ab75e54bfeb1acc6..333570b0abf88e0a4cd05af35947e3f3d3f2570f 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 e9365640108337cfe7ffe5bdb555b33b714c2aab..d699e31c4e52e1ed9d03b70a9d0b78b781ae6e77 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 11e0f511b65b68b97d05389a9ee3ae2507c54f73..a8ee8a1d60def811199885ade29502af100b7829 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 819b3ca19603fb5e98b73e73e820443a815f62f9..ca04a19ffcefe82101b264bb613d68bae55eea66 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 eb030b3179fc9ab0297cc61442f0a7bfb9a65437..3702229966b03e2fd7748b4c6ee06c8074561260 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 2d25cbe8423ec1a18330fe8e2857228a35c1cd27..aa5eef5e03afd1f6b6bd10790b4c6fbba5882a08 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 b9449483167d66c5b8a90ed407c0c6838c45f27d..e21d3efbc460319c71973fbb158c0e0c07b49b86 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 5a733959aeb6ae1cb9e8c0d5bfe9cae77ae07da1..b0001d90f0c0c37146d0c73bcf20030d5bddcbba 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 00d0cdd89daac38e1848f43cb41ce8c323685e29..8da5844cfac8578d44a05990d77ad2863ebe4e26 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 abda7d46dda04b041c0156e6e87a9b24756718f8..d64cfb69895fd763b14308bdf9df443bff60f373 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 b0629a92d072a46ec787699611066be9caefec9b..1c76a45d17fd7587b828dec57d243c5dcab23ec3 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 d737bf1e4589aa09e38487112cc4e92b23ec1053..6d391625b0cd2471336e3aa375e1c831a79d4a5c 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 34a2cf3ec3c5d1c19b95468f523b2cc5ef5a7fc7..5f76b0a998c1019a633db6d64106901e076f7edf 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 abfdd1ea18ebc8ab52fddacdb3f9fb0c611bf917..bdef8cbff4a43b674f90454466d96822b0c388b3 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 ade382cb11557fe5bc51d2f01b7b8a05d2d25f02..8d2f05e1989ffece130afbf673f1be18ddf32edf 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 ec99a1a4c88d80974211214c3d78a095d75b1fc5..254c80891fe4dc832fa18c5a95b3a0e61ef3480d 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 9a17a1e1b3776402b2cc462215c5e91347431321..2bbb2dccb280eb3bb7c1f86d5b8fc1717948c1db 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 cd161bbda7c36d7884e339caa027959b0f3f15e8..ac8dfc3a693bb90b88cb70c50bfc6fa556cddc80 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 e8fcb19c451328d749538f3260fb441144e0af80..d3f3dfb66c09817d4bb7e5bb94f363e4dc0b2534 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 07d1b46070f4099ce0ef07c802db3e1b98c0ccfd..6fbf02598180a7682bb6c6493fa4a96995c518b1 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 d465c39aec2af33ade69d7369be8218ecc6bb9e5..9e81de522697888d6e62fc6a6a0a0c7ae0e7b865 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 b22f4ddf95bfdd7fe417bd061f709843ee8dafbf..0cea1e10e62e790e039bd5ad098bdff81944650c 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 6fd85a931d66216a779ec66dee8d9d02471e6c76..fdaeae4a1b225a7fe5877762a0ea6aabb7da45f5 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 649b9d6c17832c91619c3f16cf96b0537595b9fd..ba11bd5b8b86d0fe15e00daa55ed508e8151481e 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