xo: Fix unicorn/switch-case-braces.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2023-01-03 14:30:43 -08:00
parent 1dd5269549
commit 6808b1971a
3 changed files with 32 additions and 13 deletions

View File

@@ -63,29 +63,33 @@ export class PreferenceView {
this.navItem = navItem;
this.nav.select(navItem);
switch (navItem) {
case "AddServer":
case "AddServer": {
initServersSection({
$root: this.$settingsContainer,
});
break;
}
case "General":
case "General": {
initGeneralSection({
$root: this.$settingsContainer,
});
break;
}
case "Organizations":
case "Organizations": {
initConnectedOrgSection({
$root: this.$settingsContainer,
});
break;
}
case "Network":
case "Network": {
initNetworkSection({
$root: this.$settingsContainer,
});
break;
}
case "Shortcuts": {
initShortcutsSection({
@@ -94,8 +98,9 @@ export class PreferenceView {
break;
}
default:
default: {
((n: never) => n)(navItem);
}
}
window.location.hash = `#${navItem}`;

View File

@@ -36,14 +36,21 @@ let unread = 0;
const trayIconSize = (): number => {
switch (process.platform) {
case "darwin":
case "darwin": {
return 20;
case "win32":
}
case "win32": {
return 100;
case "linux":
}
case "linux": {
return 100;
default:
}
default: {
return 80;
}
}
};

View File

@@ -30,18 +30,25 @@ function getAppDataDir() {
let base;
switch (process.platform) {
case "darwin":
case "darwin": {
base = path.join(process.env.HOME, "Library", "Application Support");
break;
case "linux":
}
case "linux": {
base =
process.env.XDG_CONFIG_HOME ?? path.join(process.env.HOME, ".config");
break;
case "win32":
}
case "win32": {
base = process.env.APPDATA;
break;
default:
}
default: {
throw new Error("Could not detect app data dir base.");
}
}
console.log("Detected App Data Dir base:", base);