diff --git a/src/main/index.js b/src/main/index.js
index caff2336..d907383c 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -645,6 +645,27 @@ ipcMain.on('save-preferences', (event, data) => {
})
})
+ipcMain.on('change-collapse', (event, value) => {
+ const preferences = new Preferences(preferencesDBPath)
+ preferences.update(
+ {
+ state: {
+ collapse: value
+ }
+ })
+ .catch((err) => {
+ log.error(err)
+ })
+})
+
+ipcMain.on('get-collapse', (event, _) => {
+ const preferences = new Preferences(preferencesDBPath)
+ preferences.load()
+ .then((conf) => {
+ event.sender.send('response-get-collapse', conf.state.collapse)
+ })
+})
+
// hashtag
ipcMain.on('save-hashtag', (event, tag) => {
const hashtags = new Hashtags(hashtagsDB)
diff --git a/src/main/preferences.js b/src/main/preferences.js
index d8fc14ec..ac3482b0 100644
--- a/src/main/preferences.js
+++ b/src/main/preferences.js
@@ -10,6 +10,9 @@ const Base = {
theme: 'white',
fontSize: 14,
displayNameStyle: 0
+ },
+ state: {
+ collapse: false
}
}
@@ -47,4 +50,11 @@ export default class Preferences {
})
})
}
+
+ async update (obj) {
+ const current = await this.load()
+ const data = objectAssignDeep({}, current, obj)
+ const result = await this.save(data)
+ return result
+ }
}
diff --git a/src/renderer/components/TimelineSpace.vue b/src/renderer/components/TimelineSpace.vue
index d2b9143d..96ec6858 100644
--- a/src/renderer/components/TimelineSpace.vue
+++ b/src/renderer/components/TimelineSpace.vue
@@ -6,7 +6,7 @@
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)">