Skip to content

Commit

Permalink
Optimizations (#60)
Browse files Browse the repository at this point in the history
Fixes and optimizations
  • Loading branch information
drishit96 authored May 20, 2024
1 parent 3cc8f10 commit 9800ef3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ newrelic_agent.log
/test-results/
/playwright-report/
/playwright/.cache/
.vscode/
2 changes: 1 addition & 1 deletion app/components/PieChartCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function PieChartCard({
<tr>
{colHeaders.map((header, index) => (
<th
className={`p-1 border border-primary ${
className={`p-1 border border-primary tabular-nums ${
index == 0 ? "text-left" : "text-right"
}`}
key={header}
Expand Down
1 change: 0 additions & 1 deletion app/modules/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export async function saveNotificationToken(userId: string, notificationToken: s
});
return true;
} catch (error) {
logError(error);
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ export default function App() {
{(location.pathname.includes("/dashboard") ||
location.pathname.includes("/reports") ||
location.pathname.includes("/settings/list")) && (
<nav className="z-20 flex justify-evenly fixed bottom-0 left-1/2 -translate-x-1/2 w-full md:w-3/4 lg:w-2/3 xl:w-1/2 backdrop-blur-3xl border border-primary text-primary rounded-t-md font-bold shadow-2xl">
<nav className="z-20 flex justify-evenly fixed bottom-0 left-1/2 -translate-x-1/2 w-full md:w-3/4 lg:w-2/3 xl:w-1/2 backdrop-blur-md border border-primary text-primary rounded-t-md font-bold shadow-2xl">
<Ripple accent>
<Link
className="flex flex-col items-center w-full p-1 focus-border"
Expand Down
15 changes: 6 additions & 9 deletions app/utils/browser.utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
export function getResolution() {
const width = window.screen.width * window.devicePixelRatio;
const height = window.screen.height * window.devicePixelRatio;
return [width, height];
}

export function isMobileView() {
if (window == null) return false;
const [width] = getResolution();
return width <= 640;
try {
if (window == null) return false;
return window.innerWidth <= 640;
} catch (e) {
return false;
}
}

export function isMobileDevice() {
Expand Down
8 changes: 3 additions & 5 deletions app/utils/category.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,13 @@ export function syncNewCustomCategoriesToLocalStorage(
? JSON.parse(existingCategoriesString)
: [];

const presetCategoriesMap = new Map<string, boolean>();
presetCategories.forEach((category) => presetCategoriesMap.set(category, true));
const existingCategoriesMap = new Map<string, boolean>();
existingCategories.forEach((category) => existingCategoriesMap.set(category, true));
const presetCategoriesSet = new Set<string>(presetCategories);
const existingCategoriesSet = new Set<string>(existingCategories);

const customCategories: string[] = [];
for (let category of categories) {
category = category.trim();
if (!presetCategoriesMap.has(category) && !existingCategoriesMap.has(category)) {
if (!presetCategoriesSet.has(category) && !existingCategoriesSet.has(category)) {
customCategories.push(category);
}
}
Expand Down
13 changes: 6 additions & 7 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
# fly.toml file generated for budgetsco on 2022-07-31T18:06:56+05:30
# fly.toml app configuration file generated for budgetsco on 2023-05-26T22:47:35+05:30

app = "budgetsco"
primary_region = "fra"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

kill_timeout = "5s"
[env]
PORT = "8080"

[experimental]
allowed_public_ports = []
auto_rollback = true

[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
[services.concurrency]
hard_limit = 500
soft_limit = 450
Expand Down

0 comments on commit 9800ef3

Please sign in to comment.