Skip to content

Commit

Permalink
Removes duplicate js files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed Apr 2, 2024
1 parent 058cabb commit 60df33c
Show file tree
Hide file tree
Showing 20 changed files with 165 additions and 6,382 deletions.
2,796 changes: 97 additions & 2,699 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions src/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ let Stream = require('mithril/stream')
import { Chess } from 'chess.js'
import { COLORS } from './Launchpad'
import { uci } from './ChessMaths'
import { playOtherSide } from './utils'
import { auth } from './User'
import { Auth } from './Auth'

export const range = (start, end) =>
Array.apply(0, Array(end - 1)).map((element, index) => index + start)
Expand Down Expand Up @@ -105,13 +102,12 @@ export const OnlineActions = (state, actions) => ({
m.redraw()
// send to lichess api
let move_uci = uci(move)
let body = state.auth.fetchBody('/api/board/game/' +
m.route.param('id') +
'/move/' +
move_uci,
let body = state.auth.fetchBody(
'/api/board/game/' + m.route.param('id') + '/move/' + move_uci,
{
method: 'post',
})
}
)
console.log('played move', move_uci, body)
},
})
14 changes: 0 additions & 14 deletions src/Board.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/Board.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './moves.css'
import { toDests } from './utils'
import m from 'mithril'
import { toDests } from './utils'
import { Chessground } from 'chessground'
import './board.css'

export const Board = cell =>
m(
Expand Down
17 changes: 16 additions & 1 deletion src/Connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const re = /^Launchpad/
const equals = (a, b) => a.length === b.length && a.every((v, i) => v === b[i])

export const ConnectActions = {
init: ({ state, update }) => {
init: ({ state, update, getState }) => {
console.log('init webmidi')
WebMidi.enable({ sysex: true })
.then(() => {
Expand All @@ -21,6 +21,7 @@ export const ConnectActions = {
ConnectActions.updateMidiDevices({ state, update })

WebMidi.addListener('connected', e => {
console.log('new device connected', e)
ConnectActions.updateMidiDevices({ state, update })
for (let input of WebMidi.inputs) {
ConnectActions.detectDevice({ state, update }, input)
Expand Down Expand Up @@ -105,6 +106,20 @@ export const ConnectActions = {
launchpads,
},
})
// Set disconnect listener
device.addListener('disconnected', e => {
console.log('Launchpad disconnected', e)
// ConnectActions.updateMidiDevices({ state, update })
// if (state.midi?.input?.id === e.port.id) {
// // ConnectActions.disconnect({ state, update })
// }
// if (state.midi?.output?.id === e.port.id) {
// // ConnectActions.disconnect({ state, update })
// }
if (state.midi?.launchpads[e.port.id]) {
update({ midi: { launchpads: { [e.port.id]: undefined } } })
}
})
// Object.assign(actions, Launchpads[key](state, actions))
// Object.assign(onlineActions, Launchpads[key](state, actions))
// device.removeListener('sysex')
Expand Down
267 changes: 0 additions & 267 deletions src/Connector.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/Login.js

This file was deleted.

Loading

0 comments on commit 60df33c

Please sign in to comment.