Skip to content

Commit

Permalink
Main IPCs refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Dec 4, 2021
1 parent f4b81e3 commit 02e08d0
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 55 deletions.
8 changes: 4 additions & 4 deletions app/application/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,12 +844,12 @@ const quickCopy = (key) => {

// ? rate
const rateAuthme = () => {
ipc.send("rate_authme")
ipc.send("rateAuthme")
}

// ? feedback
const provideFeedback = () => {
ipc.send("provide_feedback")
ipc.send("provideFeedback")
}

// ? build
Expand All @@ -862,11 +862,11 @@ if (res.build_number.startsWith("alpha")) {

// ? buttons
const createFile = () => {
ipc.send("hide_import")
ipc.send("toggleImport")
}

const configureSettings = () => {
ipc.send("hide_settings")
ipc.send("toggleSettings")
}

const supportDevelopment = () => {
Expand Down
2 changes: 1 addition & 1 deletion app/confirm/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const unhashPassword = async () => {
setInterval(() => {
password_input.fill(0)

ipc.send("to_application0")
ipc.send("toApplicationFromConfirm")

location.reload()
}, 1000)
Expand Down
14 changes: 7 additions & 7 deletions app/edit/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const loadRollback = () => {
})

reloadApplication()
reloadSettings()
reloadSettingsWindow()
}
})
}
Expand Down Expand Up @@ -312,7 +312,7 @@ const createSave = () => {
}

reloadApplication()
reloadSettings()
reloadSettingsWindow()
}
})
}
Expand Down Expand Up @@ -606,16 +606,16 @@ const loadCodes = () => {

// ? hide window
const hide = () => {
ipc.send("hide_edit")
ipc.send("toggleEdit")
}

// ? reloads
const reloadApplication = () => {
ipc.send("reload_application")
ipc.send("reloadApplicationWindow")
}

const reloadSettings = () => {
ipc.send("reload_settings")
const reloadSettingsWindow = () => {
ipc.send("reloadSettingsWindow")
}

/**
Expand Down Expand Up @@ -685,7 +685,7 @@ const deleteCodes = () => {
}

reloadApplication()
reloadSettings()
reloadSettingsWindow()

setTimeout(() => {
location.reload()
Expand Down
2 changes: 1 addition & 1 deletion app/export/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const saveQrCodes = () => {

// ? hide
const hide = () => {
ipc.send("hide_export")
ipc.send("toggleExport")
}

// ? error handling
Expand Down
2 changes: 1 addition & 1 deletion app/import/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const gaLink = () => {

// ? hide
const hide = () => {
ipc.send("hide_import")
ipc.send("toggleImport")
}

// ? build
Expand Down
4 changes: 2 additions & 2 deletions app/landing/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const hashPasswords = async () => {
setInterval(() => {
password_input.fill(0)

ipc.send("to_confirm")
ipc.send("toConfirm")

location.reload()
}, 1000)
Expand Down Expand Up @@ -228,7 +228,7 @@ const noPassword = () => {
setInterval(() => {
password.fill(0)

ipc.send("to_application1")
ipc.send("toConfirmFromLanding")

location.reload()
}, 1000)
Expand Down
24 changes: 12 additions & 12 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ if (tray_state === true) {
tgt1.textContent = "On"
tgl1.checked = true

ipc.send("enable_tray")
ipc.send("enableTray")
} else {
tgt1.textContent = "Off"
tgl1.checked = false

ipc.send("disable_tray")
ipc.send("disableTray")
}

// names
Expand Down Expand Up @@ -187,7 +187,7 @@ const startup = () => {

startup_state = false

ipc.send("disable_startup")
ipc.send("disableStartup")
} else {
settings.settings.launch_on_startup = true

Expand All @@ -198,7 +198,7 @@ const startup = () => {

startup_state = true

ipc.send("enable_startup")
ipc.send("enableStartup")
}
}

Expand All @@ -212,7 +212,7 @@ const tray = () => {
tgt1.textContent = "Off"
tray_state = false

ipc.send("disable_tray")
ipc.send("disableTray")
} else {
settings.settings.close_to_tray = true

Expand All @@ -221,7 +221,7 @@ const tray = () => {
tgt1.textContent = "On"
tray_state = true

ipc.send("enable_tray")
ipc.send("enableTray")
}
}

Expand Down Expand Up @@ -325,7 +325,7 @@ const clearData = () => {

// remove start shortcut
if (dev === false) {
ipc.send("disable_startup")
ipc.send("disableStartup")
}

// clear storage
Expand Down Expand Up @@ -556,7 +556,7 @@ const dropdownChoose = (id) => {
sort()
save()

ipc.send("reload_application")
ipc.send("reloadApplicationWindow")
}

// ? save settings
Expand All @@ -566,7 +566,7 @@ const save = () => {

// ? rate
const rateAuthme = () => {
ipc.send("rate_authme")
ipc.send("rateAuthme")
}

// ? feedback
Expand Down Expand Up @@ -681,7 +681,7 @@ const quickCopyShortcutsLink = () => {
}

const hide = () => {
ipc.send("hide_settings")
ipc.send("toggleSettings")
}

document.querySelector(".settings").disabled = true
Expand Down Expand Up @@ -797,7 +797,7 @@ const about = () => {

// ? edit
const edit = () => {
ipc.send("hide_edit")
ipc.send("toggleEdit")
}

// ? build
Expand All @@ -813,7 +813,7 @@ let online_closed = false

// ? send reload
const reload = () => {
ipc.send("reload_application")
ipc.send("reloadApplicationWindow")
}

const check_for_internet = () => {
Expand Down
Loading

0 comments on commit 02e08d0

Please sign in to comment.