Skip to content

Commit 6a98aff

Browse files
committed
Update script.js
1 parent 26de82d commit 6a98aff

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

public/script.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { ToastManager } from "./managers/toast";
22
const toastManager = new ToastManager(document.getElementById('toast-container'));
33

4+
// Global variables
5+
let currentTransactionType = 'income'; // Default transaction type
6+
let currentFilter = null; // null = show all, 'income' = only income, 'expense' = only expenses
7+
let editingTransactionId = null;
8+
let currentSortField = 'date';
9+
let currentSortDirection = 'desc';
10+
411
// Theme toggle functionality
512
function getBaseUrl() {
613
// First try to get it from the server-provided meta tag
@@ -314,19 +321,6 @@ async function handleFetchResponse(response) {
314321
return response;
315322
}
316323

317-
// Add currentFilter variable at the top with other shared variables
318-
let currentFilter = null; // null = show all, 'income' = only income, 'expense' = only expenses
319-
320-
// Add at the top with other variables
321-
let editingTransactionId = null;
322-
323-
// Add at the top with other shared variables
324-
let currentSortField = 'date';
325-
let currentSortDirection = 'desc';
326-
327-
// Add currentTransactionType as a global variable
328-
let currentTransactionType = 'income'; // Default transaction type
329-
330324
// Update loadTransactions function
331325
async function loadTransactions() {
332326
try {

0 commit comments

Comments
 (0)