Skip to content

Commit

Permalink
設定の初期化ボタン周りのバグあれこれ
Browse files Browse the repository at this point in the history
  • Loading branch information
fruitriin committed Oct 22, 2023
1 parent 17c29a4 commit ebc852c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/main/funcs/events.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// レンダラープロセスからのメッセージを受信する
import { createOptionWindow, createWindow, taskbars, windowPosition } from './windows'
import { activateWindow, grantPermission, macWindowProcesses } from './helper'
import { ipcMain, screen } from 'electron'
import { app, ipcMain, screen } from 'electron'
import { Options, store } from './store'

export function setEventHandlers() {
Expand Down Expand Up @@ -41,6 +41,8 @@ export function setEventHandlers() {
})
ipcMain.on('clearSetting', () => {
store.clear()
app.relaunch()
app.quit()
})
screen.on('display-added', (_, newDisplay) => {
createWindow(newDisplay)
Expand Down
4 changes: 1 addition & 3 deletions src/main/funcs/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function createWindow(display: Display) {
alwaysOnTop: true,
skipTaskbar: true,
show: false,
...windowPosition(display, store.get('options').layout as LayoutType)
...windowPosition(display, store.store.options.layout as LayoutType)
})

// 準備ができたら表示
Expand Down Expand Up @@ -87,8 +87,6 @@ export function windowPosition(
display: Electron.Display,
type: LayoutType
): { width: number; height: number; x: number; y: number } {
// なんかこの返り値だいぶ怪しそう

return {
// 右のときは 画面右端から - 210ピクセル
x: type === 'right' ? display.workArea.x + display.workArea.width - 210 : display.workArea.x,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/pages/option.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<label class="label">設定の初期化</label>
</div>
<div class="field-body">
<button class="button is-danger">初期化</button>
<button class="button is-danger" @click="clearSetting">初期化</button>
</div>
</div>
</template>
Expand Down

0 comments on commit ebc852c

Please sign in to comment.