diff --git a/lib/boot.ts b/lib/boot.ts index 7a1c2723c..996eba997 100644 --- a/lib/boot.ts +++ b/lib/boot.ts @@ -53,7 +53,7 @@ const run = ( ipcRenderer.send('clearCookies'); } - run(null, null, false); + history.go(); }, token, username, diff --git a/lib/dialogs/settings/index.tsx b/lib/dialogs/settings/index.tsx index bfc19b2fe..8893237a5 100644 --- a/lib/dialogs/settings/index.tsx +++ b/lib/dialogs/settings/index.tsx @@ -73,23 +73,22 @@ export class SettingsDialog extends Component { showElectronWarningDialog = () => { const dialog = __non_webpack_require__('electron').remote.dialog; // eslint-disable-line no-undef - dialog.showMessageBox( - { + dialog + .showMessageBox({ type: 'warning', buttons: ['Delete Notes', 'Cancel', 'Visit Web App'], title: 'Unsynced Notes Detected', message: 'Logging out will delete any unsynced notes. You can verify your ' + 'synced notes by logging in to the Web App.', - }, - (response) => { + }) + .then(({ response }) => { if (response === 0) { - this.signOut(); + this.props.onSignOut(); } else if (response === 2) { viewExternalUrl('https://app.simplenote.com'); } - } - ); + }); }; showWebWarningDialog = () => { diff --git a/lib/state/index.ts b/lib/state/index.ts index 9b8ba2d40..f0744622a 100644 --- a/lib/state/index.ts +++ b/lib/state/index.ts @@ -37,7 +37,7 @@ export type AppState = { unsyncedNoteIds: T.EntityId[]; }; -export const reducers = combineReducers({ +const reducers = combineReducers({ appState: appState.reducer.bind(appState), settings, tags, diff --git a/lib/state/simperium/middleware.ts b/lib/state/simperium/middleware.ts index 0753c484d..d734b2179 100644 --- a/lib/state/simperium/middleware.ts +++ b/lib/state/simperium/middleware.ts @@ -1,7 +1,6 @@ import type { Client } from 'simperium'; import debugFactory from 'debug'; -import appState from '../../flux/app-state'; import actions from '../actions'; import { toggleSystemTag } from '../domain/notes'; @@ -67,7 +66,8 @@ export const initSimperium = ( switch (action.type) { case 'LOGOUT': - return logout(); + client.reset().then(() => logout()); + return result; case 'SET_SYSTEM_TAG': noteBucket.update( diff --git a/lib/utils/filter-notes.ts b/lib/utils/filter-notes.ts index 8f8f11ed8..32190bbf7 100644 --- a/lib/utils/filter-notes.ts +++ b/lib/utils/filter-notes.ts @@ -114,7 +114,7 @@ export default function filterNotes( notesArray: T.NoteEntity[] | null = null ) { const { - data: { notes }, + appState: { notes }, ui: { openedTag, searchQuery, showTrash }, } = state; diff --git a/tsconfig.json b/tsconfig.json index 5651c3847..ff393f975 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "isolatedModules": true, "esModuleInterop": true, "types": ["dom", "jest"], - "typeRoots": ["./node_modules/@types", "./lib/typings"] + "typeRoots": ["./lib/typings", "./node_modules/@types"] }, "include": ["lib/**/*"] }