Skip to content

Commit

Permalink
Various linting fixes (#2337)
Browse files Browse the repository at this point in the history
This PR cleans up some lint warnings that have been introduced over time:

- Remove a console.log where it seemed unnecessary
- Changed a console.log to debug where it made sense to keep the logging
- Changed some variable names to distinguish from variables declared in an upper scope
  • Loading branch information
belcherj authored Sep 17, 2020
1 parent f7b672e commit ae5203c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions desktop/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ module.exports = function main() {
mainWindow.setMenuBarVisibility(!autoHideMenuBar);
});

ipcMain.on('wpLogin', function (event, url) {
shell.openExternal(url);
ipcMain.on('wpLogin', function (event, wpLoginUrl) {
shell.openExternal(wpLoginUrl);
});

ipcMain.on('importNotes', function (event, filePath) {
Expand Down
6 changes: 3 additions & 3 deletions lib/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { boot as bootLoggingOut } from './logging-out';
const config = getConfig();

const clearStorage = (): Promise<void> =>
new Promise((resolve) => {
new Promise((resolveStorage) => {
localStorage.removeItem('access_token');
localStorage.removeItem('lastSyncedTime');
localStorage.removeItem('localQueue:note');
Expand Down Expand Up @@ -57,9 +57,9 @@ const clearStorage = (): Promise<void> =>
])
.then(() => {
window.electron?.send('clearCookies');
resolve();
resolveStorage();
})
.catch(() => resolve());
.catch(() => resolveStorage());
});

const forceReload = () => history.go();
Expand Down
1 change: 0 additions & 1 deletion lib/note-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export class NoteEditor extends Component<Props> {

// toggle Markdown enabled
if (note && cmdOrCtrl && shiftKey && 'm' === key) {
console.log('toggling markdown');
toggleMarkdown(noteId, !this.markdownEnabled());
event.stopPropagation();
event.preventDefault();
Expand Down
6 changes: 5 additions & 1 deletion lib/state/electron/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import debugFactory from 'debug';

import actions from '../actions';

import * as S from '../';

const debug = debugFactory('electron-middleware');

export const middleware: S.Middleware = ({ dispatch, getState }) => {
window.electron.receive('appCommand', (command) => {
switch (command.action) {
Expand Down Expand Up @@ -82,7 +86,7 @@ export const middleware: S.Middleware = ({ dispatch, getState }) => {
return;

default:
console.log(command);
debug(`unknown AppCommand: ${command}`);
}
});

Expand Down

0 comments on commit ae5203c

Please sign in to comment.