added comments

This commit is contained in:
srgooglo 2022-05-06 19:00:29 +02:00
parent 5823d630d1
commit 3cd505a84c
2 changed files with 3 additions and 0 deletions

View File

@ -63,11 +63,13 @@ export default class ApiExtension extends Extension {
}
const handleResponse = async (data) => {
// handle token regeneration
if (data.headers?.regenerated_token) {
Session.token = data.headers.regenerated_token
console.debug("[REGENERATION] New token generated")
}
// handle 401 responses
if (data instanceof Error) {
if (data.response.status === 401) {
window.app.eventBus.emit("invalid_session")

View File

@ -7,6 +7,7 @@ export default class ShortcutsExtension extends Extension {
this.shortcuts = {}
document.addEventListener("keydown", (event) => {
// FIXME: event.key sometimes is not defined
const key = event.key.toLowerCase()
const shortcut = this.shortcuts[key]