diff --git a/src/main/index.js b/src/main/index.js index 35a1bbfe..8c7c2b4c 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -642,6 +642,30 @@ ipcMain.on('get-collapse', (event, _) => { }) }) +ipcMain.on('change-global-header', (event, value) => { + const preferences = new Preferences(preferencesDBPath) + preferences.update( + { + state: { + hideGlobalHeader: value + } + }) + .then((conf) => { + event.sender.send('response-change-global-header', conf) + }) + .catch(err => { + log.error(err) + }) +}) + +ipcMain.on('get-global-header', (event, _) => { + const preferences = new Preferences(preferencesDBPath) + preferences.load() + .then((conf) => { + event.sender.send('response-get-global-header', conf.state.hideGlobalHeader) + }) +}) + ipcMain.on('change-language', (event, value) => { const preferences = new Preferences(preferencesDBPath) preferences.update( diff --git a/src/main/preferences.js b/src/main/preferences.js index da29b0ff..b40eb6e2 100644 --- a/src/main/preferences.js +++ b/src/main/preferences.js @@ -17,7 +17,8 @@ const Base = { tootVisibility: Visibility.Public.value }, state: { - collapse: false + collapse: false, + hideGlobalHeader: false }, language: { language: Language.en.key diff --git a/src/renderer/components/GlobalHeader.vue b/src/renderer/components/GlobalHeader.vue index eaf422dc..11dace27 100644 --- a/src/renderer/components/GlobalHeader.vue +++ b/src/renderer/components/GlobalHeader.vue @@ -1,6 +1,7 @@