Code cleanup, update eslint from webapp, add ts-prune (#1884)

This commit is contained in:
Devin Binnie
2021-12-03 16:01:49 -05:00
committed by GitHub
parent 875a0f8bfd
commit 73056d2649
19 changed files with 383 additions and 336 deletions

View File

@@ -165,7 +165,7 @@ export class MattermostView extends EventEmitter {
};
}
loadRetry = (loadURL: string, err: any) => {
loadRetry = (loadURL: string, err: Error) => {
this.retryLoad = setTimeout(this.retry(loadURL), RELOAD_INTERVAL);
WindowManager.sendToRenderer(LOAD_RETRY, this.tab.name, Date.now() + RELOAD_INTERVAL, err.toString(), loadURL.toString());
log.info(`[${Util.shorten(this.tab.name)}] failed loading ${loadURL}: ${err}, retrying in ${RELOAD_INTERVAL / SECOND} seconds`);
@@ -211,7 +211,6 @@ export class MattermostView extends EventEmitter {
hide = () => this.show(false);
setBounds = (boundaries: Electron.Rectangle) => {
// todo: review this, as it might not work properly with devtools/minimizing/resizing
this.view.setBounds(boundaries);
}

View File

@@ -446,7 +446,7 @@ export class ViewManager {
}
};
sendToAllViews = (channel: string, ...args: any[]) => {
sendToAllViews = (channel: string, ...args: unknown[]) => {
this.views.forEach((view) => view.view.webContents.send(channel, ...args));
}
}

View File

@@ -126,7 +126,7 @@ const generateNewWindowListener = (getServersFunction: () => TeamWithTabs[], spe
}
// Public download links case
// TODO: We might be handling different types differently in the future, for now
// We might be handling different types differently in the future, for now
// we are going to mimic the browser and just pop a new browser window for public links
if (parsedURL.pathname.match(/^(\/api\/v[3-4]\/public)*\/files\//)) {
shell.openExternal(details.url);
@@ -218,7 +218,7 @@ export const addWebContentsEventListeners = (mmview: MattermostView, getServersF
}
const willNavigate = generateWillNavigate(getServersFunction);
contents.on('will-navigate', willNavigate as (e: Event, u: string) => void); // TODO: Electron types don't include sender for some reason
contents.on('will-navigate', willNavigate as (e: Event, u: string) => void); // Electron types don't include sender for some reason
// handle custom login requests (oath, saml):
// 1. are we navigating to a supported local custom login path from the `/login` page?