diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-04-04 08:46:54 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-04-04 08:46:54 +0900 |
| commit | d4a630902d8d250b67fcd0ce2b49240786b40368 (patch) | |
| tree | b87395691e52e3b86ce40196993d492c694c5e79 /src/client/scripts | |
| parent | enhance(server): Log error message when internal error occured (diff) | |
| download | sharkey-d4a630902d8d250b67fcd0ce2b49240786b40368.tar.gz sharkey-d4a630902d8d250b67fcd0ce2b49240786b40368.tar.bz2 sharkey-d4a630902d8d250b67fcd0ce2b49240786b40368.zip | |
refactor: Use ===
Diffstat (limited to 'src/client/scripts')
| -rw-r--r-- | src/client/scripts/hotkey.ts | 6 | ||||
| -rw-r--r-- | src/client/scripts/keycode.ts | 2 | ||||
| -rw-r--r-- | src/client/scripts/paging.ts | 2 | ||||
| -rw-r--r-- | src/client/scripts/search.ts | 4 | ||||
| -rw-r--r-- | src/client/scripts/stream.ts | 6 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/client/scripts/hotkey.ts b/src/client/scripts/hotkey.ts index 672dbedde1..7d1bb16e79 100644 --- a/src/client/scripts/hotkey.ts +++ b/src/client/scripts/hotkey.ts @@ -57,9 +57,9 @@ const ignoreElemens = ['input', 'textarea']; function match(e: KeyboardEvent, patterns: action['patterns']): boolean { const key = e.code.toLowerCase(); return patterns.some(pattern => pattern.which.includes(key) && - pattern.ctrl == e.ctrlKey && - pattern.shift == e.shiftKey && - pattern.alt == e.altKey && + pattern.ctrl === e.ctrlKey && + pattern.shift === e.shiftKey && + pattern.alt === e.altKey && !e.metaKey ); } diff --git a/src/client/scripts/keycode.ts b/src/client/scripts/keycode.ts index 5786c1dc0a..c127d54bb2 100644 --- a/src/client/scripts/keycode.ts +++ b/src/client/scripts/keycode.ts @@ -1,5 +1,5 @@ export default (input: string): string[] => { - if (Object.keys(aliases).some(a => a.toLowerCase() == input.toLowerCase())) { + if (Object.keys(aliases).some(a => a.toLowerCase() === input.toLowerCase())) { const codes = aliases[input]; return Array.isArray(codes) ? codes : [codes]; } else { diff --git a/src/client/scripts/paging.ts b/src/client/scripts/paging.ts index 1656e263fb..048c797753 100644 --- a/src/client/scripts/paging.ts +++ b/src/client/scripts/paging.ts @@ -20,7 +20,7 @@ export default (opts) => ({ computed: { empty(): boolean { - return this.items.length == 0 && !this.fetching && this.inited; + return this.items.length === 0 && !this.fetching && this.inited; }, error(): boolean { diff --git a/src/client/scripts/search.ts b/src/client/scripts/search.ts index 02dd39b035..16057dfd34 100644 --- a/src/client/scripts/search.ts +++ b/src/client/scripts/search.ts @@ -47,9 +47,9 @@ export async function search(v: any, q: string) { uri: q }); dialog.close(); - if (res.type == 'User') { + if (res.type === 'User') { v.$router.push(`/@${res.object.username}@${res.object.host}`); - } else if (res.type == 'Note') { + } else if (res.type === 'Note') { v.$router.push(`/notes/${res.object.id}`); } } catch (e) { diff --git a/src/client/scripts/stream.ts b/src/client/scripts/stream.ts index 18bb7c13df..4dcd3f1b2e 100644 --- a/src/client/scripts/stream.ts +++ b/src/client/scripts/stream.ts @@ -68,7 +68,7 @@ export default class Stream extends EventEmitter { */ @autobind private onOpen() { - const isReconnect = this.state == 'reconnecting'; + const isReconnect = this.state === 'reconnecting'; this.state = 'connected'; this.emit('_connected_'); @@ -87,7 +87,7 @@ export default class Stream extends EventEmitter { */ @autobind private onClose() { - if (this.state == 'connected') { + if (this.state === 'connected') { this.state = 'reconnecting'; this.emit('_disconnected_'); } @@ -100,7 +100,7 @@ export default class Stream extends EventEmitter { private onMessage(message) { const { type, body } = JSON.parse(message.data); - if (type == 'channel') { + if (type === 'channel') { const id = body.id; let connections: Connection[]; |