2020-08-22 22:39:31 +00:00
|
|
|
import store from '@/store'
|
|
|
|
|
2020-04-21 20:20:19 +00:00
|
|
|
export const socket = io.connect(window.location.href)
|
2020-05-05 20:27:37 +00:00
|
|
|
|
|
|
|
socket.on('connect', () => {
|
2020-06-18 18:06:14 +00:00
|
|
|
document.getElementById('start_app_placeholder').classList.add('loading_placeholder--hidden')
|
2020-05-05 20:27:37 +00:00
|
|
|
})
|
2020-08-22 21:34:16 +00:00
|
|
|
|
2020-08-31 20:14:14 +00:00
|
|
|
socket.on('init_charts', charts => {
|
2020-09-15 20:44:29 +00:00
|
|
|
// store.dispatch('cacheCharts', charts)
|
2020-08-31 20:14:14 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
socket.on('init_favorites', favorites => {
|
2020-09-15 20:44:29 +00:00
|
|
|
// store.dispatch('setFavorites', favorites)
|
2020-08-31 20:14:14 +00:00
|
|
|
})
|
2020-08-22 21:34:16 +00:00
|
|
|
|
2020-08-24 19:30:54 +00:00
|
|
|
socket.on('init_settings', (settings, credentials, defaults) => {
|
|
|
|
store.dispatch('setSettings', settings)
|
2020-08-25 21:17:23 +00:00
|
|
|
store.dispatch('setDefaultSettings', defaults)
|
|
|
|
store.dispatch('setCredentials', credentials)
|
2020-08-24 19:30:54 +00:00
|
|
|
})
|
|
|
|
|
2020-08-22 22:39:31 +00:00
|
|
|
socket.on('init_home', data => {
|
|
|
|
store.dispatch('cacheHomeData', data)
|
|
|
|
})
|
2020-09-15 16:11:29 +00:00
|
|
|
|
|
|
|
socket.on('init_update', data => {
|
|
|
|
store.dispatch('setAboutInfo', data)
|
|
|
|
})
|