Skip to content

Commit 3a5cb71

Browse files
committed
refactor: rename var to litInitializationAttempted for clarity
1 parent 7de94b5 commit 3a5cb71

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/invoice-dashboard/src/lib/view-requests.svelte

+7-7
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
{ value: "pending", checked: false },
136136
];
137137
138-
let initializationAttempted = false;
138+
let litInitializationAttempted = false;
139139
140140
// Track initialization state
141141
let initialized = false;
@@ -227,7 +227,7 @@
227227
await initializeLitSession(currentAccount);
228228
} else {
229229
console.log("Skipping Lit initialization as decryption is off");
230-
initializationAttempted = true;
230+
litInitializationAttempted = true;
231231
}
232232
233233
console.log("Fetching requests");
@@ -288,7 +288,7 @@
288288
}
289289
290290
// Reset state for new account
291-
initializationAttempted = false;
291+
litInitializationAttempted = false;
292292
initialized = false;
293293
previousAddress = undefined;
294294
clearLitStorage();
@@ -352,7 +352,7 @@
352352
previousAddress = currentAccount.address;
353353
354354
// Skip Lit initialization if decryption is off
355-
if (sliderValueForDecryption === "on" && !initializationAttempted) {
355+
if (sliderValueForDecryption === "on" && !litInitializationAttempted) {
356356
await initializeLitSession(currentAccount);
357357
}
358358
@@ -446,14 +446,14 @@
446446
const initializeLitSession = async (
447447
currentAccount: GetAccountReturnType | undefined
448448
) => {
449-
if (!currentAccount?.address || !cipherProvider || initializationAttempted) {
449+
if (!currentAccount?.address || !cipherProvider || litInitializationAttempted) {
450450
console.error(
451451
"Initialization skipped: Missing account, cipherProvider, or already attempted."
452452
);
453453
return;
454454
}
455455
456-
initializationAttempted = true;
456+
litInitializationAttempted = true;
457457
458458
try {
459459
const storedSig = localStorage?.getItem("lit-wallet-sig");
@@ -919,7 +919,7 @@
919919
console.log("Current state:", {
920920
address: account?.address,
921921
initialized,
922-
initializationAttempted,
922+
litInitializationAttempted,
923923
hasRequests: requests?.length > 0,
924924
isLoading: loading,
925925
decryptionEnabled: sliderValueForDecryption === "on"

0 commit comments

Comments
 (0)