Skip to content

Commit 36b620a

Browse files
author
Ajit Kumar
committed
fix: correct typos in sessionStorage keys for file restoration handling
1 parent 917916e commit 36b620a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/handlers/intent.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default async function HandleIntent(intent = {}) {
4444
return;
4545
}
4646

47-
if (sessionStorage.getItem("isfilesRestored") === "true") {
47+
if (sessionStorage.getItem("isfileRestored") === "true") {
4848
await openFile(url, {
4949
mode: "single",
5050
render: true,
@@ -77,11 +77,11 @@ export function removeIntentHandler(handler) {
7777

7878
/**
7979
* Process all pending intents that were queued before files were restored.
80-
* This function is called after isfilesRestored is set to true in main.js.
80+
* This function is called after isfileRestored is set to true in main.js.
8181
* @returns {Promise<void>}
8282
*/
8383
export async function processPendingIntents() {
84-
if (sessionStorage.getItem("isfilesRestored") !== "true") return;
84+
if (sessionStorage.getItem("isfileRestored") !== "true") return;
8585

8686
// Process all pending intents
8787
while (pendingIntents.length > 0) {

src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ async function loadApp() {
605605
try {
606606
await restoreFiles(files);
607607
// save state to handle file loading gracefully
608-
sessionStorage.setItem("isfilesRestored", true);
608+
sessionStorage.setItem("isfileRestored", true);
609609
// Process any pending intents that were queued before files were restored
610610
await processPendingIntents();
611611
} catch (error) {
@@ -615,7 +615,7 @@ async function loadApp() {
615615
}
616616
} else {
617617
// Even when no files need to be restored, mark as restored and process pending intents
618-
sessionStorage.setItem("isfilesRestored", true);
618+
sessionStorage.setItem("isfileRestored", true);
619619
await processPendingIntents();
620620
onEditorUpdate(undefined, false);
621621
}

src/sidebarApps/sidebarApp.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let $apps;
33
/**@type {HTMLElement} */
44
let $sidebar;
55
/**@type {HTMLElement} */
6-
let $contaienr;
6+
let $container;
77

88
export default class SidebarApp {
99
/**@type {HTMLSpanElement} */
@@ -93,14 +93,14 @@ export default class SidebarApp {
9393
// Try to replace the old container, or append if it's not in the DOM
9494
try {
9595
if (oldContainer && oldContainer.parentNode === $sidebar) {
96-
$sidebar.replaceChild($contaienr, oldContainer);
96+
$sidebar.replaceChild($container, oldContainer);
9797
} else {
9898
// Old container not in sidebar, just append the new one
9999
const existingContainer = $sidebar.get(".container");
100100
if (existingContainer) {
101-
$sidebar.replaceChild($contaienr, existingContainer);
101+
$sidebar.replaceChild($container, existingContainer);
102102
} else {
103-
$sidebar.appendChild($contaienr);
103+
$sidebar.appendChild($container);
104104
}
105105
}
106106
} catch (error) {
@@ -110,7 +110,7 @@ export default class SidebarApp {
110110
if (existingContainer) {
111111
existingContainer.remove();
112112
}
113-
$sidebar.appendChild($contaienr);
113+
$sidebar.appendChild($container);
114114
}
115115
this.#onselect(this.#container);
116116
}
@@ -168,10 +168,10 @@ function Icon({ icon, id, title }) {
168168
* @returns {HTMLElement}
169169
*/
170170
function getContainer($el) {
171-
const res = $contaienr;
171+
const res = $container;
172172

173173
if ($el) {
174-
$contaienr = $el;
174+
$container = $el;
175175
}
176176

177177
return res || $sidebar.get(".container");

0 commit comments

Comments
 (0)