-
diff --git a/src/SyncGate.tsx b/src/SyncGate.tsx
index e8be9c2..f4a3fb0 100644
--- a/src/SyncGate.tsx
+++ b/src/SyncGate.tsx
@@ -123,7 +123,7 @@ class SyncGate extends React.PureComponent
{
if (!journalAction.error) {
store.dispatch(fetchEntries(this.props.etesync, collection.uid));
}
- });
+ });
});
});
};
@@ -162,14 +162,14 @@ class SyncGate extends React.PureComponent {
const errors: Array<{journal: string, error: Error}> = [];
this.props.entries.forEach((entry, journal) => {
if (entry.error) {
- errors.push({journal, error: entry.error});
+ errors.push({ journal, error: entry.error });
}
});
if (errors.length > 0) {
return (
- {errors.map((error) => (- {error.journal}: {error.error.toString()}
))}
+ {errors.map((error, idx) => (- {error.journal}: {error.error.toString()}
))}
);
}
@@ -178,8 +178,8 @@ class SyncGate extends React.PureComponent {
if ((this.props.userInfo.value === null) || (journals === null) ||
((this.props.fetchCount > 0) &&
((entryArrays.size === 0) || !entryArrays.every((x: any) => (x.value !== null))))
- ) {
- return ();
+ ) {
+ return ();
}
// FIXME: Shouldn't be here
@@ -193,13 +193,13 @@ class SyncGate extends React.PureComponent {
(
+ render={() => (
)}
/>
(
+ render={({ history }) => (
<>
{
(
+ render={({ history }) => (
@@ -238,7 +238,7 @@ class SyncGate extends React.PureComponent {
}
}
-const mapStateToProps = (state: StoreState, props: PropsType) => {
+const mapStateToProps = (state: StoreState, _props: PropsType) => {
return {
settings: state.settings,
journals: state.cache.journals,
diff --git a/src/api/EteSync.test.ts b/src/api/EteSync.test.ts
index 62332d4..208ab8a 100644
--- a/src/api/EteSync.test.ts
+++ b/src/api/EteSync.test.ts
@@ -30,7 +30,7 @@ it('Simple sync', async () => {
const uid1 = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash('id1'));
const cryptoManager = new EteSync.CryptoManager(keyBase64, USER);
- const info1 = new EteSync.CollectionInfo({uid: uid1, content: 'test', displayName: 'Dislpay 1'});
+ const info1 = new EteSync.CollectionInfo({ uid: uid1, content: 'test', displayName: 'Dislpay 1' });
const journal = new EteSync.Journal();
journal.setInfo(cryptoManager, info1);
@@ -66,7 +66,7 @@ it('Journal Entry sync', async () => {
const uid1 = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash('id1'));
const cryptoManager = new EteSync.CryptoManager(keyBase64, USER);
- const info1 = new EteSync.CollectionInfo({uid: uid1, content: 'test', displayName: 'Dislpay 1'});
+ const info1 = new EteSync.CollectionInfo({ uid: uid1, content: 'test', displayName: 'Dislpay 1' });
const journal = new EteSync.Journal();
journal.setInfo(cryptoManager, info1);
@@ -77,7 +77,7 @@ it('Journal Entry sync', async () => {
let entries = await entryManager.list(null);
expect(entries.length).toBe(0);
- const syncEntry = new EteSync.SyncEntry({action: 'ADD', content: 'bla'});
+ const syncEntry = new EteSync.SyncEntry({ action: 'ADD', content: 'bla' });
let prevUid = null;
const entry = new EteSync.Entry();
entry.setSyncEntry(cryptoManager, syncEntry, prevUid);
diff --git a/src/api/EteSync.ts b/src/api/EteSync.ts
index b14341f..fabf02f 100644
--- a/src/api/EteSync.ts
+++ b/src/api/EteSync.ts
@@ -48,7 +48,7 @@ function CastJson(json: any, to: any) {
}
function hmacToHex(hmac: byte[]): string {
- return sjcl.codec.hex.fromBits(sjcl.codec.bytes.toBits(hmac));
+ return sjcl.codec.hex.fromBits(sjcl.codec.bytes.toBits(hmac));
}
export class Credentials {
@@ -497,7 +497,7 @@ export class EntryManager extends BaseManager {
super(credentials, apiBase, ['journals', journalId, 'entries', '']);
}
- public list(lastUid: string | null, limit: number = 0): Promise {
+ public list(lastUid: string | null, limit = 0): Promise {
let apiBase = this.apiBase.clone();
apiBase = apiBase.search({
last: (lastUid !== null) ? lastUid : undefined,
diff --git a/src/components/AddressBook.tsx b/src/components/AddressBook.tsx
index e8811b1..dc24e26 100644
--- a/src/components/AddressBook.tsx
+++ b/src/components/AddressBook.tsx
@@ -48,7 +48,7 @@ const AddressBookItem = React.memo((_props: any) => {
return (
+
{name && name[0].toUpperCase()}
}
primaryText={name}
@@ -64,7 +64,7 @@ const sortSelector = createSelector(
const a = _a.fn;
const b = _b.fn;
- return a.localeCompare(b, undefined, {sensitivity: 'base'});
+ return a.localeCompare(b, undefined, { sensitivity: 'base' });
});
}
);
diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx
index 1929456..778f361 100644
--- a/src/components/Calendar.tsx
+++ b/src/components/Calendar.tsx
@@ -72,7 +72,7 @@ class Calendar extends React.PureComponent {
});
return (
-
+
{
selectable
onSelectEvent={this.props.onItemClick as any}
onSelectSlot={this.slotClicked as any}
- formats={{agendaHeaderFormat: agendaHeaderFormat as any}}
+ formats={{ agendaHeaderFormat: agendaHeaderFormat as any }}
eventPropGetter={eventPropGetter}
date={this.state.currentDate}
onNavigate={this.onNavigate}
@@ -93,11 +93,11 @@ class Calendar extends React.PureComponent {
}
private onNavigate(currentDate: Date) {
- this.setState({currentDate});
+ this.setState({ currentDate });
}
private onView(view: string) {
- this.setState({view});
+ this.setState({ view });
}
private slotClicked(slotInfo: {start: Date, end: Date}) {
diff --git a/src/components/Contact.tsx b/src/components/Contact.tsx
index 462b819..6d454e2 100644
--- a/src/components/Contact.tsx
+++ b/src/components/Contact.tsx
@@ -16,7 +16,7 @@ import { IconButton } from '@material-ui/core';
class Contact extends React.PureComponent {
public props: {
- item?: ContactType,
+ item?: ContactType;
};
public render() {
diff --git a/src/components/ContactEdit.tsx b/src/components/ContactEdit.tsx
index 8ac8545..0d319fe 100644
--- a/src/components/ContactEdit.tsx
+++ b/src/components/ContactEdit.tsx
@@ -24,24 +24,24 @@ import * as EteSync from '../api/EteSync';
import { ContactType } from '../pim-types';
const telTypes = [
- {type: 'Home'},
- {type: 'Work'},
- {type: 'Cell'},
- {type: 'Other'},
+ { type: 'Home' },
+ { type: 'Work' },
+ { type: 'Cell' },
+ { type: 'Other' },
];
const emailTypes = telTypes;
const addressTypes = [
- {type: 'Home'},
- {type: 'Work'},
- {type: 'Other'},
+ { type: 'Home' },
+ { type: 'Work' },
+ { type: 'Other' },
];
const imppTypes = [
- {type: 'Jabber'},
- {type: 'Hangouts'},
- {type: 'Other'},
+ { type: 'Jabber' },
+ { type: 'Hangouts' },
+ { type: 'Other' },
];
const TypeSelector = (props: any) => {
@@ -122,7 +122,7 @@ interface PropsType {
class ContactEdit extends React.PureComponent {
public state: {
- uid: string,
+ uid: string;
fn: string;
phone: ValueType[];
email: ValueType[];
@@ -297,7 +297,7 @@ class ContactEdit extends React.PureComponent {
setProperties('email', this.state.email);
setProperties('adr', this.state.address);
setProperties('impp', this.state.impp.map((x) => (
- {type: x.type, value: x.type + ':' + x.value}
+ { type: x.type, value: x.type + ':' + x.value }
)));
function setProperty(name: string, value: string) {
@@ -341,7 +341,7 @@ class ContactEdit extends React.PureComponent {
{this.props.item ? 'Edit Contact' : 'New Contact'}
@@ -518,15 +518,15 @@ class ContactEdit extends React.PureComponent
{
- this.props.onDelete(this.props.item!, this.props.initialCollection!)}
- onCancel={() => this.setState({showDeleteDialog: false})}
- >
+ this.props.onDelete(this.props.item!, this.props.initialCollection!)}
+ onCancel={() => this.setState({ showDeleteDialog: false })}
+ >
Are you sure you would like to delete this contact?
-
+
);
}
diff --git a/src/components/EncryptionLoginForm.tsx b/src/components/EncryptionLoginForm.tsx
index b90dd93..97be3ac 100644
--- a/src/components/EncryptionLoginForm.tsx
+++ b/src/components/EncryptionLoginForm.tsx
@@ -8,7 +8,7 @@ interface FormErrors {
class EncryptionLoginForm extends React.PureComponent {
public state: {
- errors: FormErrors,
+ errors: FormErrors;
encryptionPassword: string;
};
@@ -48,10 +48,10 @@ class EncryptionLoginForm extends React.PureComponent {
}
if (Object.keys(errors).length) {
- this.setState({errors});
+ this.setState({ errors });
return;
} else {
- this.setState({errors: {}});
+ this.setState({ errors: {} });
}
this.props.onSubmit(encryptionPassword);
diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx
index 9c5cc6c..9ee09e8 100644
--- a/src/components/ErrorBoundary.tsx
+++ b/src/components/ErrorBoundary.tsx
@@ -6,17 +6,21 @@ import { resetKey } from '../store/actions';
import { EncryptionPasswordError, IntegrityError } from '../api/EteSync';
import PrettyError from '../widgets/PrettyError';
-class ErrorBoundary extends React.Component {
+interface PropsType {
+ children: React.ReactNode | React.ReactNode[];
+}
+
+class ErrorBoundary extends React.Component {
public state: {
error?: Error;
};
- constructor(props: any) {
+ constructor(props: PropsType) {
super(props);
this.state = { };
}
- public componentDidCatch(error: Error, info: any) {
+ public componentDidCatch(error: Error, _info: any) {
if (error instanceof EncryptionPasswordError) {
store.dispatch(resetKey());
} else if (error instanceof IntegrityError) {
@@ -46,7 +50,7 @@ class ErrorBoundary extends React.Component {
Please log out from the menu, refresh the page and try again, and if the problem persists, contact support.
- {error.message}
+ {error.message}
);
diff --git a/src/components/Event.tsx b/src/components/Event.tsx
index 6942deb..32d6379 100644
--- a/src/components/Event.tsx
+++ b/src/components/Event.tsx
@@ -8,7 +8,7 @@ import { EventType } from '../pim-types';
class Event extends React.PureComponent {
public props: {
- item?: EventType,
+ item?: EventType;
};
public render() {
diff --git a/src/components/EventEdit.tsx b/src/components/EventEdit.tsx
index 513fcf9..90706ed 100644
--- a/src/components/EventEdit.tsx
+++ b/src/components/EventEdit.tsx
@@ -42,7 +42,7 @@ interface PropsType {
class EventEdit extends React.PureComponent
{
public state: {
- uid: string,
+ uid: string;
title: string;
allDay: boolean;
start?: Date;
@@ -143,14 +143,14 @@ class EventEdit extends React.PureComponent {
}
public toggleAllDay() {
- this.setState({allDay: !this.state.allDay});
+ this.setState({ allDay: !this.state.allDay });
}
public onSubmit(e: React.FormEvent) {
e.preventDefault();
if ((!this.state.start) || (!this.state.end)) {
- this.setState({error: 'Both start and end time must be set!'});
+ this.setState({ error: 'Both start and end time must be set!' });
return;
}
@@ -173,7 +173,7 @@ class EventEdit extends React.PureComponent {
}
if (startDate.compare(endDate) >= 0) {
- this.setState({error: 'End time must be later than start time!'});
+ this.setState({ error: 'End time must be later than start time!' });
return;
}
@@ -242,7 +242,7 @@ class EventEdit extends React.PureComponent {
onChange={this.handleInputChange}
/>
-
+
Saving to
@@ -277,7 +277,7 @@ class EventEdit extends React.PureComponent {
dateOnly={this.state.allDay}
placeholder="Start"
value={this.state.start}
- onChange={(date?: Date) => this.setState({start: date})}
+ onChange={(date?: Date) => this.setState({ start: date })}
/>