Merge pull request #196 from h3poteto/iss-193
closes #193 Add sound setting in preferences, and save setting data in json
This commit is contained in:
commit
ca4da4317e
|
@ -494,7 +494,6 @@
|
||||||
"version": "2.6.0",
|
"version": "2.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz",
|
||||||
"integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==",
|
"integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"lodash": "4.17.5"
|
"lodash": "4.17.5"
|
||||||
}
|
}
|
||||||
|
@ -4510,6 +4509,18 @@
|
||||||
"integrity": "sha1-FOb9pcaOnk7L7/nM8DfL18BcWv4=",
|
"integrity": "sha1-FOb9pcaOnk7L7/nM8DfL18BcWv4=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"electron-json-storage": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/electron-json-storage/-/electron-json-storage-4.0.2.tgz",
|
||||||
|
"integrity": "sha1-wNZizNAbxlZ9YHjxemhCrHQyjOQ=",
|
||||||
|
"requires": {
|
||||||
|
"async": "2.6.0",
|
||||||
|
"lodash": "4.17.5",
|
||||||
|
"mkdirp": "0.5.1",
|
||||||
|
"rimraf": "2.6.2",
|
||||||
|
"rwlock": "5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"electron-localshortcut": {
|
"electron-localshortcut": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/electron-localshortcut/-/electron-localshortcut-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron-localshortcut/-/electron-localshortcut-3.1.0.tgz",
|
||||||
|
@ -13270,6 +13281,11 @@
|
||||||
"aproba": "1.2.0"
|
"aproba": "1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rwlock": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/rwlock/-/rwlock-5.0.0.tgz",
|
||||||
|
"integrity": "sha1-iI1qd6M1HMGiCSBO8u4XIgk4Ns8="
|
||||||
|
},
|
||||||
"rx": {
|
"rx": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
|
||||||
|
|
|
@ -83,6 +83,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
|
"electron-json-storage": "^4.0.2",
|
||||||
"electron-log": "^2.2.14",
|
"electron-log": "^2.2.14",
|
||||||
"electron-window-state": "^4.1.1",
|
"electron-window-state": "^4.1.1",
|
||||||
"element-ui": "^2.2.1",
|
"element-ui": "^2.2.1",
|
||||||
|
|
|
@ -11,6 +11,7 @@ import path from 'path'
|
||||||
import Authentication from './auth'
|
import Authentication from './auth'
|
||||||
import Account from './account'
|
import Account from './account'
|
||||||
import Streaming from './streaming'
|
import Streaming from './streaming'
|
||||||
|
import Preferences from './preferences'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set log level
|
* Set log level
|
||||||
|
@ -33,17 +34,24 @@ const winURL = process.env.NODE_ENV === 'development'
|
||||||
|
|
||||||
// https://github.com/louischatriot/nedb/issues/459
|
// https://github.com/louischatriot/nedb/issues/459
|
||||||
const userData = app.getPath('userData')
|
const userData = app.getPath('userData')
|
||||||
const databasePath = process.env.NODE_ENV === 'production'
|
const accountDBPath = process.env.NODE_ENV === 'production'
|
||||||
? userData + '/db/account.db'
|
? userData + '/db/account.db'
|
||||||
: 'account.db'
|
: 'account.db'
|
||||||
let db = new Datastore({
|
let accountDB = new Datastore({
|
||||||
filename: databasePath,
|
filename: accountDBPath,
|
||||||
autoload: true
|
autoload: true
|
||||||
})
|
})
|
||||||
|
const preferencesDBPath = process.env.NODE_ENV === 'production'
|
||||||
|
? userData + './db/preferences.json'
|
||||||
|
: 'preferences.json'
|
||||||
|
|
||||||
|
const soundBasePath = process.env.NODE_ENV === 'development'
|
||||||
|
? path.join(__dirname, '../../build/sounds/')
|
||||||
|
: path.join(process.resourcesPath, 'build/sounds/')
|
||||||
|
|
||||||
async function listAccounts () {
|
async function listAccounts () {
|
||||||
try {
|
try {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
await account.cleanup()
|
await account.cleanup()
|
||||||
const accounts = await account.listAccounts()
|
const accounts = await account.listAccounts()
|
||||||
return accounts
|
return accounts
|
||||||
|
@ -221,7 +229,7 @@ app.on('activate', () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let auth = new Authentication(new Account(db))
|
let auth = new Authentication(new Account(accountDB))
|
||||||
|
|
||||||
ipcMain.on('get-auth-url', (event, domain) => {
|
ipcMain.on('get-auth-url', (event, domain) => {
|
||||||
auth.getAuthorizationUrl(domain)
|
auth.getAuthorizationUrl(domain)
|
||||||
|
@ -244,7 +252,7 @@ ipcMain.on('get-access-token', (event, code) => {
|
||||||
event.sender.send('error-get-access-token', err)
|
event.sender.send('error-get-access-token', err)
|
||||||
})
|
})
|
||||||
.then((token) => {
|
.then((token) => {
|
||||||
db.findOne({
|
accountDB.findOne({
|
||||||
accessToken: token
|
accessToken: token
|
||||||
}, (err, doc) => {
|
}, (err, doc) => {
|
||||||
if (err) return event.sender.send('error-get-access-token', err)
|
if (err) return event.sender.send('error-get-access-token', err)
|
||||||
|
@ -265,7 +273,7 @@ ipcMain.on('get-social-token', (event, _) => {
|
||||||
|
|
||||||
// nedb
|
// nedb
|
||||||
ipcMain.on('list-accounts', (event, _) => {
|
ipcMain.on('list-accounts', (event, _) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
account.listAccounts()
|
account.listAccounts()
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
|
@ -277,7 +285,7 @@ ipcMain.on('list-accounts', (event, _) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('get-local-account', (event, id) => {
|
ipcMain.on('get-local-account', (event, id) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
account.getAccount(id)
|
account.getAccount(id)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
|
@ -289,7 +297,7 @@ ipcMain.on('get-local-account', (event, id) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('update-account', (event, acct) => {
|
ipcMain.on('update-account', (event, acct) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
const id = acct._id
|
const id = acct._id
|
||||||
delete acct._id
|
delete acct._id
|
||||||
account.updateAccount(id, acct)
|
account.updateAccount(id, acct)
|
||||||
|
@ -302,7 +310,7 @@ ipcMain.on('update-account', (event, acct) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('remove-account', (event, id) => {
|
ipcMain.on('remove-account', (event, id) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
account.removeAccount(id)
|
account.removeAccount(id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
event.sender.send('response-remove-account')
|
event.sender.send('response-remove-account')
|
||||||
|
@ -313,7 +321,7 @@ ipcMain.on('remove-account', (event, id) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('forward-account', (event, acct) => {
|
ipcMain.on('forward-account', (event, acct) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
account.forwardAccount(acct)
|
account.forwardAccount(acct)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
event.sender.send('response-forward-account')
|
event.sender.send('response-forward-account')
|
||||||
|
@ -324,7 +332,7 @@ ipcMain.on('forward-account', (event, acct) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('backward-account', (event, acct) => {
|
ipcMain.on('backward-account', (event, acct) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
account.backwardAccount(acct)
|
account.backwardAccount(acct)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
event.sender.send('response-backward-account')
|
event.sender.send('response-backward-account')
|
||||||
|
@ -338,7 +346,7 @@ ipcMain.on('backward-account', (event, acct) => {
|
||||||
let userStreaming = null
|
let userStreaming = null
|
||||||
|
|
||||||
ipcMain.on('start-user-streaming', (event, ac) => {
|
ipcMain.on('start-user-streaming', (event, ac) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
account.getAccount(ac._id)
|
account.getAccount(ac._id)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
|
@ -377,7 +385,7 @@ ipcMain.on('stop-user-streaming', (event, _) => {
|
||||||
let localStreaming = null
|
let localStreaming = null
|
||||||
|
|
||||||
ipcMain.on('start-local-streaming', (event, ac) => {
|
ipcMain.on('start-local-streaming', (event, ac) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
account.getAccount(ac._id)
|
account.getAccount(ac._id)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
|
@ -412,7 +420,7 @@ ipcMain.on('stop-local-streaming', (event, _) => {
|
||||||
let publicStreaming = null
|
let publicStreaming = null
|
||||||
|
|
||||||
ipcMain.on('start-public-streaming', (event, ac) => {
|
ipcMain.on('start-public-streaming', (event, ac) => {
|
||||||
const account = new Account(db)
|
const account = new Account(accountDB)
|
||||||
account.getAccount(ac._id)
|
account.getAccount(ac._id)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
|
@ -445,22 +453,55 @@ ipcMain.on('stop-public-streaming', (event, _) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
// sounds
|
// sounds
|
||||||
ipcMain.on('operation-sound01', (event, _) => {
|
ipcMain.on('fav-rt-action-sound', (event, _) => {
|
||||||
const sound = process.env.NODE_ENV === 'development'
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
? path.join(__dirname, '../../build/sounds/operation_sound01.wav')
|
preferences.load()
|
||||||
: path.join(process.resourcesPath, 'build/sounds/operation_sound01.wav')
|
.then((conf) => {
|
||||||
simplayer(sound, (err) => {
|
if (conf.general.sound.fav_rb) {
|
||||||
if (err) log.error(err)
|
const sound = path.join(soundBasePath, 'operation_sound01.wav')
|
||||||
})
|
simplayer(sound, (err) => {
|
||||||
|
if (err) log.error(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => log.error(err))
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('operation-sound02', (event, _) => {
|
ipcMain.on('toot-action-sound', (event, _) => {
|
||||||
const sound = process.env.NODE_ENV === 'development'
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
? path.join(__dirname, '../../build/sounds/operation_sound02.wav')
|
preferences.load()
|
||||||
: path.join(process.resourcesPath, 'build/sounds/operation_sound02.wav')
|
.then((conf) => {
|
||||||
simplayer(sound, (err) => {
|
if (conf.general.sound.toot) {
|
||||||
if (err) log.error(err)
|
const sound = path.join(soundBasePath, 'operation_sound02.wav')
|
||||||
})
|
simplayer(sound, (err) => {
|
||||||
|
if (err) log.error(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => log.error(err))
|
||||||
|
})
|
||||||
|
|
||||||
|
// preferences
|
||||||
|
ipcMain.on('get-preferences', (event, _) => {
|
||||||
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
|
preferences.load()
|
||||||
|
.then((conf) => {
|
||||||
|
event.sender.send('response-get-preferences', conf)
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
event.sender.send('error-get-preferences', err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
ipcMain.on('save-preferences', (event, data) => {
|
||||||
|
const preferences = new Preferences(preferencesDBPath)
|
||||||
|
preferences.save(data)
|
||||||
|
.then((conf) => {
|
||||||
|
event.sender.send('response-save-preferences', conf)
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
event.sender.send('error-save-preferences', err)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
import empty from 'is-empty'
|
||||||
|
import storage from 'electron-json-storage'
|
||||||
|
|
||||||
|
const Base = {
|
||||||
|
general: {
|
||||||
|
sound: {
|
||||||
|
fav_rb: true,
|
||||||
|
toot: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default class Preferences {
|
||||||
|
constructor (path) {
|
||||||
|
this.path = path
|
||||||
|
this.data = Base
|
||||||
|
}
|
||||||
|
|
||||||
|
async load () {
|
||||||
|
try {
|
||||||
|
const preferences = await this.get()
|
||||||
|
if (empty(preferences)) return Base
|
||||||
|
return preferences
|
||||||
|
} catch (err) {
|
||||||
|
return Base
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get () {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
storage.get(this.path, (err, data) => {
|
||||||
|
if (err) return reject(err)
|
||||||
|
this.data = data
|
||||||
|
return resolve(data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
save (data) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
storage.set(this.path, data, (err) => {
|
||||||
|
if (err) return reject(err)
|
||||||
|
this.data = data
|
||||||
|
return resolve(data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +1,94 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="general">
|
<div id="general" v-loading="loading">
|
||||||
Comming soon
|
<h2>General</h2>
|
||||||
|
<div class="sounds">
|
||||||
|
<h3>Sounds</h3>
|
||||||
|
<table class="sounds">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="title">Favourite, Reblog action sound:</td>
|
||||||
|
<td class="status">
|
||||||
|
<el-switch
|
||||||
|
v-model="sound_fav_rb"
|
||||||
|
active-color="#13ce66">
|
||||||
|
</el-switch>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="title">Toot action sound:</td>
|
||||||
|
<td class="status">
|
||||||
|
<el-switch
|
||||||
|
v-model="sound_toot"
|
||||||
|
active-color="#13ce66">
|
||||||
|
</el-switch>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'general'
|
name: 'general',
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
loading: state => state.Preferences.General.loading
|
||||||
|
}),
|
||||||
|
sound_fav_rb: {
|
||||||
|
get () {
|
||||||
|
return this.$store.state.Preferences.General.general.sound.fav_rb
|
||||||
|
},
|
||||||
|
set (value) {
|
||||||
|
this.$store.dispatch('Preferences/General/updateSound', {
|
||||||
|
fav_rb: value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sound_toot: {
|
||||||
|
get () {
|
||||||
|
return this.$store.state.Preferences.General.general.sound.toot
|
||||||
|
},
|
||||||
|
set (value) {
|
||||||
|
this.$store.dispatch('Preferences/General/updateSound', {
|
||||||
|
toot: value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.$store.dispatch('Preferences/General/loadGeneral')
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Failed to load preferences',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.sounds {
|
||||||
|
color: #606266;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
td {
|
||||||
|
padding: 16px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: right;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
width: 50%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -8,7 +8,7 @@ const App = {
|
||||||
actions: {
|
actions: {
|
||||||
watchShortcutsEvents () {
|
watchShortcutsEvents () {
|
||||||
ipcRenderer.on('open-preferences', (event) => {
|
ipcRenderer.on('open-preferences', (event) => {
|
||||||
router.push('/preferences/account')
|
router.push('/preferences/general')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
removeShortcutsEvents () {
|
removeShortcutsEvents () {
|
||||||
|
|
|
@ -1,8 +1,63 @@
|
||||||
|
import { ipcRenderer } from 'electron'
|
||||||
|
|
||||||
const General = {
|
const General = {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {},
|
state: {
|
||||||
mutations: {},
|
general: {
|
||||||
actions: {}
|
sound: {
|
||||||
|
fav_rb: true,
|
||||||
|
toot: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loading: false
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
updateGeneral (state, conf) {
|
||||||
|
state.general = conf
|
||||||
|
},
|
||||||
|
changeLoading (state, value) {
|
||||||
|
state.loading = value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
loadGeneral ({ commit }) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
commit('changeLoading', true)
|
||||||
|
ipcRenderer.send('get-preferences')
|
||||||
|
ipcRenderer.once('error-get-preferences', (event, err) => {
|
||||||
|
ipcRenderer.removeAllListeners('response-get-preferences')
|
||||||
|
commit('changeLoading', false)
|
||||||
|
reject(err)
|
||||||
|
})
|
||||||
|
ipcRenderer.once('response-get-preferences', (event, conf) => {
|
||||||
|
ipcRenderer.removeAllListeners('error-get-preferences')
|
||||||
|
commit('updateGeneral', conf.general)
|
||||||
|
commit('changeLoading', false)
|
||||||
|
resolve(conf)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
updateSound ({ commit, state }, sound) {
|
||||||
|
commit('changeLoading', true)
|
||||||
|
const newSound = Object.assign({}, state.general.sound, sound)
|
||||||
|
const newGeneral = Object.assign({}, state.general, {
|
||||||
|
sound: newSound
|
||||||
|
})
|
||||||
|
const config = {
|
||||||
|
general: newGeneral
|
||||||
|
}
|
||||||
|
ipcRenderer.send('save-preferences', config)
|
||||||
|
ipcRenderer.once('error-save-preferences', (event, err) => {
|
||||||
|
ipcRenderer.removeAllListeners('response-save-preferences')
|
||||||
|
commit('changeLoading', false)
|
||||||
|
})
|
||||||
|
ipcRenderer.once('response-save-preferences', (event, conf) => {
|
||||||
|
ipcRenderer.removeAllListeners('error-save-preferences')
|
||||||
|
commit('updateGeneral', conf.general)
|
||||||
|
commit('changeLoading', false)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default General
|
export default General
|
||||||
|
|
|
@ -20,7 +20,7 @@ const Toot = {
|
||||||
// Reblog target status is in the data.reblog.
|
// Reblog target status is in the data.reblog.
|
||||||
// So I send data.reblog as status for update local timeline.
|
// So I send data.reblog as status for update local timeline.
|
||||||
commit('TimelineSpace/updateToot', data.reblog, { root: true })
|
commit('TimelineSpace/updateToot', data.reblog, { root: true })
|
||||||
ipcRenderer.send('operation-sound01')
|
ipcRenderer.send('fav-rt-action-sound')
|
||||||
resolve(data.reblog)
|
resolve(data.reblog)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -51,7 +51,7 @@ const Toot = {
|
||||||
client.post(`/statuses/${message.id}/favourite`, {}, (err, data, res) => {
|
client.post(`/statuses/${message.id}/favourite`, {}, (err, data, res) => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
commit('TimelineSpace/updateToot', data, { root: true })
|
commit('TimelineSpace/updateToot', data, { root: true })
|
||||||
ipcRenderer.send('operation-sound01')
|
ipcRenderer.send('fav-rt-action-sound')
|
||||||
resolve(data)
|
resolve(data)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -48,7 +48,7 @@ const NewToot = {
|
||||||
)
|
)
|
||||||
client.post('/statuses', form, (err, data, res) => {
|
client.post('/statuses', form, (err, data, res) => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
ipcRenderer.send('operation-sound02')
|
ipcRenderer.send('toot-action-sound')
|
||||||
resolve(res)
|
resolve(res)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue